(function (j, r) {
    function u() {
        if (!b.isReady) {
            try {
                d.documentElement.doScroll("left")
            } catch (a) {
                setTimeout(u, 1);
                return
            }
            b.ready()
        }
    }
    function O(a, c) {
        c.src ? b.ajax({
            url: c.src,
            async: false,
            dataType: "script"
        }) : b.globalEval(c.text || c.textContent || c.innerHTML || "");
        c.parentNode && c.parentNode.removeChild(c)
    }
    function L(a, c, e, g, f, l) {
        var n = a.length;
        if (typeof c === "object") {
            for (var x in c) L(a, x, c[x], g, f, e);
            return a
        }
        if (e !== r) {
            g = !l && g && b.isFunction(e);
            for (x = 0; x < n; x++) f(a[x], c, g ? e.call(a[x], x, f(a[x], c)) : e, l);
            return a
        }
        return n ? f(a[0], c) : r
    }
    function I() {
        return (new Date).getTime()
    }
    function V() {
        return false
    }
    function W() {
        return true
    }
    function M(a, c, e) {
        e[0].type = a;
        return b.event.handle.apply(c, e)
    }
    function Z(a) {
        var c, e = [],
            g = [],
            f = arguments,
            l, n, x, s, y, D;
        n = b.data(this, "events");
        if (!(a.liveFired === this || !n || !n.live || a.button && a.type === "click")) {
            a.liveFired = this;
            var S = n.live.slice(0);
            for (s = 0; s < S.length; s++) {
                n = S[s];
                n.origType.replace(sa, "") === a.type ? g.push(n.selector) : S.splice(s--, 1)
            }
            l = b(a.target).closest(g, a.currentTarget);
            y = 0;
            for (D = l.length; y < D; y++) for (s = 0; s < S.length; s++) {
                n = S[s];
                if (l[y].selector === n.selector) {
                    x = l[y].elem;
                    g = null;
                    if (n.preType === "mouseenter" || n.preType === "mouseleave") g = b(a.relatedTarget).closest(n.selector)[0];
                    if (!g || g !== x) e.push({
                        elem: x,
                        handleObj: n
                    })
                }
            }
            y = 0;
            for (D = e.length; y < D; y++) {
                l = e[y];
                a.currentTarget = l.elem;
                a.data = l.handleObj.data;
                a.handleObj = l.handleObj;
                if (l.handleObj.origHandler.apply(l.elem, f) === false) {
                    c = false;
                    break
                }
            }
            return c
        }
    }
    function ga(a, c) {
        return "live." + (a && a !== "*" ? a + "." : "") + c.replace(/\./g, "`").replace(/ /g, "&")
    }
    function T(a, c) {
        var e = 0;
        c.each(function () {
            if (this.nodeName === (a[e] && a[e].nodeName)) {
                var g = b.data(a[e++]),
                    f = b.data(this, g);
                if (g = g && g.events) {
                    delete f.handle;
                    f.events = {};
                    for (var l in g) for (var n in g[l]) b.event.add(this, l, g[l][n], g[l][n].data)
                }
            }
        })
    }
    function ea(a, c, e) {
        var g, f, l;
        c = c && c[0] ? c[0].ownerDocument || c[0] : d;
        if (a.length === 1 && typeof a[0] === "string" && a[0].length < 512 && c === d && !Ha.test(a[0]) && (b.support.checkClone || !Ia.test(a[0]))) {
            f = true;
            if (l = b.fragments[a[0]]) if (l !== 1) g = l
        }
        if (!g) {
            g = c.createDocumentFragment();
            b.clean(a, c, g, e)
        }
        if (f) b.fragments[a[0]] = l ? g : 1;
        return {
            fragment: g,
            cacheable: f
        }
    }
    function ca(a, c) {
        var e = {};
        b.each(Ja.concat.apply([], Ja.slice(0, c)), function () {
            e[this] = a
        });
        return e
    }
    function fa(a) {
        return "scrollTo" in a && a.document ? a : a.nodeType === 9 ? a.defaultView || a.parentWindow : false
    }
    var b = function (a, c) {
            return new b.fn.init(a, c)
        },
        ka = j.jQuery,
        t = j.$,
        d = j.document,
        i, m = /^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,
        o = /^.[^:#\[\.,]*$/,
        z = /\S/,
        C = /^(\s|\u00A0)+|(\s|\u00A0)+$/g,
        F = /^<(\w+)\s*\/?>(?:<\/\1>)?$/,
        E = navigator.userAgent,
        p = false,
        v = [],
        H, J = Object.prototype.toString,
        K = Object.prototype.hasOwnProperty,
        P = Array.prototype.push,
        R = Array.prototype.slice,
        da = Array.prototype.indexOf;
    b.fn = b.prototype = {
        init: function (a, c) {
            var e, g;
            if (!a) return this;
            if (a.nodeType) {
                this.context = this[0] = a;
                this.length = 1;
                return this
            }
            if (a === "body" && !c) {
                this.context = d;
                this[0] = d.body;
                this.selector = "body";
                this.length = 1;
                return this
            }
            if (typeof a === "string") if ((e = m.exec(a)) && (e[1] || !c)) if (e[1]) {
                g = c ? c.ownerDocument || c : d;
                if (a = F.exec(a)) if (b.isPlainObject(c)) {
                    a = [d.createElement(a[1])];
                    b.fn.attr.call(a, c, true)
                } else a = [g.createElement(a[1])];
                else {
                    a = ea([e[1]], [g]);
                    a = (a.cacheable ? a.fragment.cloneNode(true) : a.fragment).childNodes
                }
                return b.merge(this, a)
            } else {
                if (c = d.getElementById(e[2])) {
                    if (c.id !== e[2]) return i.find(a);
                    this.length = 1;
                    this[0] = c
                }
                this.context = d;
                this.selector = a;
                return this
            } else if (!c && /^\w+$/.test(a)) {
                this.selector = a;
                this.context = d;
                a = d.getElementsByTagName(a);
                return b.merge(this, a)
            } else return !c || c.jquery ? (c || i).find(a) : b(c).find(a);
            else if (b.isFunction(a)) return i.ready(a);
            if (a.selector !== r) {
                this.selector = a.selector;
                this.context = a.context
            }
            return b.makeArray(a, this)
        },
        selector: "",
        jquery: "1.4.2",
        length: 0,
        size: function () {
            return this.length
        },
        toArray: function () {
            return R.call(this, 0)
        },
        get: function (a) {
            return a == null ? this.toArray() : a < 0 ? this.slice(a)[0] : this[a]
        },
        pushStack: function (a, c, e) {
            var g = b();
            b.isArray(a) ? P.apply(g, a) : b.merge(g, a);
            g.prevObject = this;
            g.context = this.context;
            if (c === "find") g.selector = this.selector + (this.selector ? " " : "") + e;
            else if (c) g.selector = this.selector + "." + c + "(" + e + ")";
            return g
        },
        each: function (a, c) {
            return b.each(this, a, c)
        },
        ready: function (a) {
            b.bindReady();
            if (b.isReady) a.call(d, b);
            else v && v.push(a);
            return this
        },
        eq: function (a) {
            return a === -1 ? this.slice(a) : this.slice(a, +a + 1)
        },
        first: function () {
            return this.eq(0)
        },
        last: function () {
            return this.eq(-1)
        },
        slice: function () {
            return this.pushStack(R.apply(this, arguments), "slice", R.call(arguments).join(","))
        },
        map: function (a) {
            return this.pushStack(b.map(this, function (c, e) {
                return a.call(c, e, c)
            }))
        },
        end: function () {
            return this.prevObject || b(null)
        },
        push: P,
        sort: [].sort,
        splice: [].splice
    };
    b.fn.init.prototype = b.fn;
    b.extend = b.fn.extend = function () {
        var a = arguments[0] || {},
            c = 1,
            e = arguments.length,
            g = false,
            f, l, n, x;
        if (typeof a === "boolean") {
            g = a;
            a = arguments[1] || {};
            c = 2
        }
        if (typeof a !== "object" && !b.isFunction(a)) a = {};
        if (e === c) {
            a = this;
            --c
        }
        for (; c < e; c++) if ((f = arguments[c]) != null) for (l in f) {
            n = a[l];
            x = f[l];
            if (a !== x) if (g && x && (b.isPlainObject(x) || b.isArray(x))) {
                n = n && (b.isPlainObject(n) || b.isArray(n)) ? n : b.isArray(x) ? [] : {};
                a[l] = b.extend(g, n, x)
            } else if (x !== r) a[l] = x
        }
        return a
    };
    b.extend({
        noConflict: function (a) {
            j.$ = t;
            if (a) j.jQuery = ka;
            return b
        },
        isReady: false,
        ready: function () {
            if (!b.isReady) {
                if (!d.body) return setTimeout(b.ready, 13);
                b.isReady = true;
                if (v) {
                    for (var a, c = 0; a = v[c++];) a.call(d, b);
                    v = null
                }
                b.fn.triggerHandler && b(d).triggerHandler("ready")
            }
        },
        bindReady: function () {
            if (!p) {
                p = true;
                if (d.readyState === "complete") return b.ready();
                if (d.addEventListener) {
                    d.addEventListener("DOMContentLoaded", H, false);
                    j.addEventListener("load", b.ready, false)
                } else if (d.attachEvent) {
                    d.attachEvent("onreadystatechange", H);
                    j.attachEvent("onload", b.ready);
                    var a = false;
                    try {
                        a = j.frameElement == null
                    } catch (c) {}
                    d.documentElement.doScroll && a && u()
                }
            }
        },
        isFunction: function (a) {
            return J.call(a) === "[object Function]"
        },
        isArray: function (a) {
            return J.call(a) === "[object Array]"
        },
        isPlainObject: function (a) {
            if (!a || J.call(a) !== "[object Object]" || a.nodeType || a.setInterval) return false;
            if (a.constructor && !K.call(a, "constructor") && !K.call(a.constructor.prototype, "isPrototypeOf")) return false;
            for (var c in a);
            return c === r || K.call(a, c)
        },
        isEmptyObject: function (a) {
            for (var c in a) return false;
            return true
        },
        error: function (a) {
            throw a;
        },
        parseJSON: function (a) {
            if (typeof a !== "string" || !a) return null;
            a = b.trim(a);
            if (/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]").replace(/(?:^|:|,)(?:\s*\[)+/g, ""))) return j.JSON && j.JSON.parse ? j.JSON.parse(a) : (new Function("return " + a))();
            else b.error("Invalid JSON: " + a)
        },
        noop: function () {},
        globalEval: function (a) {
            if (a && z.test(a)) {
                var c = d.getElementsByTagName("head")[0] || d.documentElement,
                    e = d.createElement("script");
                e.type = "text/javascript";
                if (b.support.scriptEval) e.appendChild(d.createTextNode(a));
                else e.text = a;
                c.insertBefore(e, c.firstChild);
                c.removeChild(e)
            }
        },
        nodeName: function (a, c) {
            return a.nodeName && a.nodeName.toUpperCase() === c.toUpperCase()
        },
        each: function (a, c, e) {
            var g, f = 0,
                l = a.length,
                n = l === r || b.isFunction(a);
            if (e) if (n) for (g in a) {
                if (c.apply(a[g], e) === false) break
            } else for (; f < l;) {
                if (c.apply(a[f++], e) === false) break
            } else if (n) for (g in a) {
                if (c.call(a[g], g, a[g]) === false) break
            } else for (e = a[0]; f < l && c.call(e, f, e) !== false; e = a[++f]);
            return a
        },
        trim: function (a) {
            return (a || "").replace(C, "")
        },
        makeArray: function (a, c) {
            c = c || [];
            if (a != null) a.length == null || typeof a === "string" || b.isFunction(a) || typeof a !== "function" && a.setInterval ? P.call(c, a) : b.merge(c, a);
            return c
        },
        inArray: function (a, c) {
            if (c.indexOf) return c.indexOf(a);
            for (var e = 0, g = c.length; e < g; e++) if (c[e] === a) return e;
            return -1
        },
        merge: function (a, c) {
            var e = a.length,
                g = 0;
            if (typeof c.length === "number") for (var f = c.length; g < f; g++) a[e++] = c[g];
            else for (; c[g] !== r;) a[e++] = c[g++];
            a.length = e;
            return a
        },
        grep: function (a, c, e) {
            for (var g = [], f = 0, l = a.length; f < l; f++)!e !== !c(a[f], f) && g.push(a[f]);
            return g
        },
        map: function (a, c, e) {
            for (var g = [], f, l = 0, n = a.length; l < n; l++) {
                f = c(a[l], l, e);
                if (f != null) g[g.length] = f
            }
            return g.concat.apply([], g)
        },
        guid: 1,
        proxy: function (a, c, e) {
            if (arguments.length === 2) if (typeof c === "string") {
                e = a;
                a = e[c];
                c = r
            } else if (c && !b.isFunction(c)) {
                e = c;
                c = r
            }
            if (!c && a) c = function () {
                return a.apply(e || this, arguments)
            };
            if (a) c.guid = a.guid = a.guid || c.guid || b.guid++;
            return c
        },
        uaMatch: function (a) {
            a = a.toLowerCase();
            a = /(webkit)[ \/]([\w.]+)/.exec(a) || /(opera)(?:.*version)?[ \/]([\w.]+)/.exec(a) || /(msie) ([\w.]+)/.exec(a) || !/compatible/.test(a) && /(mozilla)(?:.*? rv:([\w.]+))?/.exec(a) || [];
            return {
                browser: a[1] || "",
                version: a[2] || "0"
            }
        },
        browser: {}
    });
    E = b.uaMatch(E);
    if (E.browser) {
        b.browser[E.browser] = true;
        b.browser.version = E.version
    }
    if (b.browser.webkit) b.browser.safari = true;
    if (da) b.inArray = function (a, c) {
        return da.call(c, a)
    };
    i = b(d);
    if (d.addEventListener) H = function () {
        d.removeEventListener("DOMContentLoaded", H, false);
        b.ready()
    };
    else if (d.attachEvent) H = function () {
        if (d.readyState === "complete") {
            d.detachEvent("onreadystatechange", H);
            b.ready()
        }
    };
    (function () {
        b.support = {};
        var a = d.documentElement,
            c = d.createElement("script"),
            e = d.createElement("div"),
            g = "script" + I();
        e.style.display = "none";
        e.innerHTML = "   <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
        var f = e.getElementsByTagName("*"),
            l = e.getElementsByTagName("a")[0];
        if (!(!f || !f.length || !l)) {
            b.support = {
                leadingWhitespace: e.firstChild.nodeType === 3,
                tbody: !e.getElementsByTagName("tbody").length,
                htmlSerialize: !! e.getElementsByTagName("link").length,
                style: /red/.test(l.getAttribute("style")),
                hrefNormalized: l.getAttribute("href") === "/a",
                opacity: /^0.55$/.test(l.style.opacity),
                cssFloat: !! l.style.cssFloat,
                checkOn: e.getElementsByTagName("input")[0].value === "on",
                optSelected: d.createElement("select").appendChild(d.createElement("option")).selected,
                parentNode: e.removeChild(e.appendChild(d.createElement("div"))).parentNode === null,
                deleteExpando: true,
                checkClone: false,
                scriptEval: false,
                noCloneEvent: true,
                boxModel: null
            };
            c.type = "text/javascript";
            try {
                c.appendChild(d.createTextNode("window." + g + "=1;"))
            } catch (n) {}
            a.insertBefore(c, a.firstChild);
            if (j[g]) {
                b.support.scriptEval = true;
                delete j[g]
            }
            try {
                delete c.test
            } catch (x) {
                b.support.deleteExpando = false
            }
            a.removeChild(c);
            if (e.attachEvent && e.fireEvent) {
                e.attachEvent("onclick", function s() {
                    b.support.noCloneEvent = false;
                    e.detachEvent("onclick", s)
                });
                e.cloneNode(true).fireEvent("onclick")
            }
            e = d.createElement("div");
            e.innerHTML = "<input type='radio' name='radiotest' checked='checked'/>";
            a = d.createDocumentFragment();
            a.appendChild(e.firstChild);
            b.support.checkClone = a.cloneNode(true).cloneNode(true).lastChild.checked;
            b(function () {
                var s = d.createElement("div");
                s.style.width = s.style.paddingLeft = "1px";
                d.body.appendChild(s);
                b.boxModel = b.support.boxModel = s.offsetWidth === 2;
                d.body.removeChild(s).style.display = "none"
            });
            a = function (s) {
                var y = d.createElement("div");
                s = "on" + s;
                var D = s in y;
                if (!D) {
                    y.setAttribute(s, "return;");
                    D = typeof y[s] === "function"
                }
                return D
            };
            b.support.submitBubbles = a("submit");
            b.support.changeBubbles = a("change");
            a = c = e = f = l = null
        }
    })();
    b.props = {
        "for": "htmlFor",
        "class": "className",
        readonly: "readOnly",
        maxlength: "maxLength",
        cellspacing: "cellSpacing",
        rowspan: "rowSpan",
        colspan: "colSpan",
        tabindex: "tabIndex",
        usemap: "useMap",
        frameborder: "frameBorder"
    };
    var $ = "jQuery" + I(),
        la = 0,
        oa = {};
    b.extend({
        cache: {},
        expando: $,
        noData: {
            embed: true,
            object: true,
            applet: true
        },
        data: function (a, c, e) {
            if (!(a.nodeName && b.noData[a.nodeName.toLowerCase()])) {
                a = a == j ? oa : a;
                var g = a[$],
                    f = b.cache;
                if (!g && typeof c === "string" && e === r) return null;
                g || (g = ++la);
                if (typeof c === "object") {
                    a[$] = g;
                    f[g] = b.extend(true, {}, c)
                } else if (!f[g]) {
                    a[$] = g;
                    f[g] = {}
                }
                a = f[g];
                if (e !== r) a[c] = e;
                return typeof c === "string" ? a[c] : a
            }
        },
        removeData: function (a, c) {
            if (!(a.nodeName && b.noData[a.nodeName.toLowerCase()])) {
                a = a == j ? oa : a;
                var e = a[$],
                    g = b.cache,
                    f = g[e];
                if (c) {
                    if (f) {
                        delete f[c];
                        b.isEmptyObject(f) && b.removeData(a)
                    }
                } else {
                    if (b.support.deleteExpando) delete a[b.expando];
                    else a.removeAttribute && a.removeAttribute(b.expando);
                    delete g[e]
                }
            }
        }
    });
    b.fn.extend({
        data: function (a, c) {
            if (typeof a === "undefined" && this.length) return b.data(this[0]);
            else if (typeof a === "object") return this.each(function () {
                b.data(this, a)
            });
            var e = a.split(".");
            e[1] = e[1] ? "." + e[1] : "";
            if (c === r) {
                var g = this.triggerHandler("getData" + e[1] + "!", [e[0]]);
                if (g === r && this.length) g = b.data(this[0], a);
                return g === r && e[1] ? this.data(e[0]) : g
            } else return this.trigger("setData" + e[1] + "!", [e[0], c]).each(function () {
                b.data(this, a, c)
            })
        },
        removeData: function (a) {
            return this.each(function () {
                b.removeData(this, a)
            })
        }
    });
    b.extend({
        queue: function (a, c, e) {
            if (a) {
                c = (c || "fx") + "queue";
                var g = b.data(a, c);
                if (!e) return g || [];
                if (!g || b.isArray(e)) g = b.data(a, c, b.makeArray(e));
                else g.push(e);
                return g
            }
        },
        dequeue: function (a, c) {
            c = c || "fx";
            var e = b.queue(a, c),
                g = e.shift();
            if (g === "inprogress") g = e.shift();
            if (g) {
                c === "fx" && e.unshift("inprogress");
                g.call(a, function () {
                    b.dequeue(a, c)
                })
            }
        }
    });
    b.fn.extend({
        queue: function (a, c) {
            if (typeof a !== "string") {
                c = a;
                a = "fx"
            }
            if (c === r) return b.queue(this[0], a);
            return this.each(function () {
                var e = b.queue(this, a, c);
                a === "fx" && e[0] !== "inprogress" && b.dequeue(this, a)
            })
        },
        dequeue: function (a) {
            return this.each(function () {
                b.dequeue(this, a)
            })
        },
        delay: function (a, c) {
            a = b.fx ? b.fx.speeds[a] || a : a;
            c = c || "fx";
            return this.queue(c, function () {
                var e = this;
                setTimeout(function () {
                    b.dequeue(e, c)
                }, a)
            })
        },
        clearQueue: function (a) {
            return this.queue(a || "fx", [])
        }
    });
    var pa = /[\n\t]/g,
        xa = /\s+/,
        Za = /\r/g,
        $a = /href|src|style/,
        ab = /(button|input)/i,
        bb = /(button|input|object|select|textarea)/i,
        cb = /^(a|area)$/i,
        Ka = /radio|checkbox/;
    b.fn.extend({
        attr: function (a, c) {
            return L(this, a, c, true, b.attr)
        },
        removeAttr: function (a) {
            return this.each(function () {
                b.attr(this, a, "");
                this.nodeType === 1 && this.removeAttribute(a)
            })
        },
        addClass: function (a) {
            if (b.isFunction(a)) return this.each(function (y) {
                var D = b(this);
                D.addClass(a.call(this, y, D.attr("class")))
            });
            if (a && typeof a === "string") for (var c = (a || "").split(xa), e = 0, g = this.length; e < g; e++) {
                var f = this[e];
                if (f.nodeType === 1) if (f.className) {
                    for (var l = " " + f.className + " ", n = f.className, x = 0, s = c.length; x < s; x++) if (l.indexOf(" " + c[x] + " ") < 0) n += " " + c[x];
                    f.className = b.trim(n)
                } else f.className = a
            }
            return this
        },
        removeClass: function (a) {
            if (b.isFunction(a)) return this.each(function (s) {
                var y = b(this);
                y.removeClass(a.call(this, s, y.attr("class")))
            });
            if (a && typeof a === "string" || a === r) for (var c = (a || "").split(xa), e = 0, g = this.length; e < g; e++) {
                var f = this[e];
                if (f.nodeType === 1 && f.className) if (a) {
                    for (var l = (" " + f.className + " ").replace(pa, " "), n = 0, x = c.length; n < x; n++) l = l.replace(" " + c[n] + " ", " ");
                    f.className = b.trim(l)
                } else f.className = ""
            }
            return this
        },
        toggleClass: function (a, c) {
            var e = typeof a,
                g = typeof c === "boolean";
            if (b.isFunction(a)) return this.each(function (f) {
                var l = b(this);
                l.toggleClass(a.call(this, f, l.attr("class"), c), c)
            });
            return this.each(function () {
                if (e === "string") for (var f, l = 0, n = b(this), x = c, s = a.split(xa); f = s[l++];) {
                    x = g ? x : !n.hasClass(f);
                    n[x ? "addClass" : "removeClass"](f)
                } else if (e === "undefined" || e === "boolean") {
                    this.className && b.data(this, "__className__", this.className);
                    this.className = this.className || a === false ? "" : b.data(this, "__className__") || ""
                }
            })
        },
        hasClass: function (a) {
            a = " " + a + " ";
            for (var c = 0, e = this.length; c < e; c++) if ((" " + this[c].className + " ").replace(pa, " ").indexOf(a) > -1) return true;
            return false
        },
        val: function (a) {
            if (a === r) {
                var c = this[0];
                if (c) {
                    if (b.nodeName(c, "option")) return (c.attributes.value || {}).specified ? c.value : c.text;
                    if (b.nodeName(c, "select")) {
                        var e = c.selectedIndex,
                            g = [],
                            f = c.options;
                        c = c.type === "select-one";
                        if (e < 0) return null;
                        var l = c ? e : 0;
                        for (e = c ? e + 1 : f.length; l < e; l++) {
                            var n = f[l];
                            if (n.selected) {
                                a = b(n).val();
                                if (c) return a;
                                g.push(a)
                            }
                        }
                        return g
                    }
                    if (Ka.test(c.type) && !b.support.checkOn) return c.getAttribute("value") === null ? "on" : c.value;
                    return (c.value || "").replace(Za, "")
                }
                return r
            }
            var x = b.isFunction(a);
            return this.each(function (s) {
                var y = b(this),
                    D = a;
                if (this.nodeType === 1) {
                    if (x) D = a.call(this, s, y.val());
                    if (typeof D === "number") D += "";
                    if (b.isArray(D) && Ka.test(this.type)) this.checked = b.inArray(y.val(), D) >= 0;
                    else if (b.nodeName(this, "select")) {
                        var S = b.makeArray(D);
                        b("option", this).each(function () {
                            this.selected = b.inArray(b(this).val(), S) >= 0
                        });
                        if (!S.length) this.selectedIndex = -1
                    } else this.value = D
                }
            })
        }
    });
    b.extend({
        attrFn: {
            val: true,
            css: true,
            html: true,
            text: true,
            data: true,
            width: true,
            height: true,
            offset: true
        },
        attr: function (a, c, e, g) {
            if (!a || a.nodeType === 3 || a.nodeType === 8) return r;
            if (g && c in b.attrFn) return b(a)[c](e);
            g = a.nodeType !== 1 || !b.isXMLDoc(a);
            var f = e !== r;
            c = g && b.props[c] || c;
            if (a.nodeType === 1) {
                var l = $a.test(c);
                if (c in a && g && !l) {
                    if (f) {
                        c === "type" && ab.test(a.nodeName) && a.parentNode && b.error("type property can't be changed");
                        a[c] = e
                    }
                    if (b.nodeName(a, "form") && a.getAttributeNode(c)) return a.getAttributeNode(c).nodeValue;
                    if (c === "tabIndex") return (c = a.getAttributeNode("tabIndex")) && c.specified ? c.value : bb.test(a.nodeName) || cb.test(a.nodeName) && a.href ? 0 : r;
                    return a[c]
                }
                if (!b.support.style && g && c === "style") {
                    if (f) a.style.cssText = "" + e;
                    return a.style.cssText
                }
                f && a.setAttribute(c, "" + e);
                a = !b.support.hrefNormalized && g && l ? a.getAttribute(c, 2) : a.getAttribute(c);
                return a === null ? r : a
            }
            return b.style(a, c, e)
        }
    });
    var sa = /\.(.*)$/,
        db = function (a) {
            return a.replace(/[^\w\s\.\|`]/g, function (c) {
                return "\\" + c
            })
        };
    b.event = {
        add: function (a, c, e, g) {
            if (!(a.nodeType === 3 || a.nodeType === 8)) {
                if (a.setInterval && a !== j && !a.frameElement) a = j;
                var f, l;
                if (e.handler) {
                    f = e;
                    e = f.handler
                }
                if (!e.guid) e.guid = b.guid++;
                if (l = b.data(a)) {
                    var n = l.events = l.events || {},
                        x = l.handle;
                    if (!x) l.handle = x = function () {
                        return typeof b !== "undefined" && !b.event.triggered ? b.event.handle.apply(x.elem, arguments) : r
                    };
                    x.elem = a;
                    c = c.split(" ");
                    for (var s, y = 0, D; s = c[y++];) {
                        l = f ? b.extend({}, f) : {
                            handler: e,
                            data: g
                        };
                        if (s.indexOf(".") > -1) {
                            D = s.split(".");
                            s = D.shift();
                            l.namespace = D.slice(0).sort().join(".")
                        } else {
                            D = [];
                            l.namespace = ""
                        }
                        l.type = s;
                        l.guid = e.guid;
                        var S = n[s],
                            Y = b.event.special[s] || {};
                        if (!S) {
                            S = n[s] = [];
                            if (!Y.setup || Y.setup.call(a, g, D, x) === false) if (a.addEventListener) a.addEventListener(s, x, false);
                            else a.attachEvent && a.attachEvent("on" + s, x)
                        }
                        if (Y.add) {
                            Y.add.call(a, l);
                            if (!l.handler.guid) l.handler.guid = e.guid
                        }
                        S.push(l);
                        b.event.global[s] = true
                    }
                    a = null
                }
            }
        },
        global: {},
        remove: function (a, c, e, g) {
            if (!(a.nodeType === 3 || a.nodeType === 8)) {
                var f, l = 0,
                    n, x, s, y, D, S, Y = b.data(a),
                    ba = Y && Y.events;
                if (Y && ba) {
                    if (c && c.type) {
                        e = c.handler;
                        c = c.type
                    }
                    if (!c || typeof c === "string" && c.charAt(0) === ".") {
                        c = c || "";
                        for (f in ba) b.event.remove(a, f + c)
                    } else {
                        for (c = c.split(" "); f = c[l++];) {
                            y = f;
                            n = f.indexOf(".") < 0;
                            x = [];
                            if (!n) {
                                x = f.split(".");
                                f = x.shift();
                                s = RegExp("(^|\\.)" + b.map(x.slice(0).sort(), db).join("\\.(?:.*\\.)?") + "(\\.|$)")
                            }
                            if (D = ba[f]) if (e) {
                                y = b.event.special[f] || {};
                                for (aa = g || 0; aa < D.length; aa++) {
                                    S = D[aa];
                                    if (e.guid === S.guid) {
                                        if (n || s.test(S.namespace)) {
                                            g == null && D.splice(aa--, 1);
                                            y.remove && y.remove.call(a, S)
                                        }
                                        if (g != null) break
                                    }
                                }
                                if (D.length === 0 || g != null && D.length === 1) {
                                    if (!y.teardown || y.teardown.call(a, x) === false) La(a, f, Y.handle);
                                    delete ba[f]
                                }
                            } else for (var aa = 0; aa < D.length; aa++) {
                                S = D[aa];
                                if (n || s.test(S.namespace)) {
                                    b.event.remove(a, y, S.handler, aa);
                                    D.splice(aa--, 1)
                                }
                            }
                        }
                        if (b.isEmptyObject(ba)) {
                            if (c = Y.handle) c.elem = null;
                            delete Y.events;
                            delete Y.handle;
                            b.isEmptyObject(Y) && b.removeData(a)
                        }
                    }
                }
            }
        },
        trigger: function (a, c, e, g) {
            var f = a.type || a;
            if (!g) {
                a = typeof a === "object" ? a[$] ? a : b.extend(b.Event(f), a) : b.Event(f);
                if (f.indexOf("!") >= 0) {
                    a.type = f = f.slice(0, -1);
                    a.exclusive = true
                }
                if (!e) {
                    a.stopPropagation();
                    b.event.global[f] && b.each(b.cache, function () {
                        this.events && this.events[f] && b.event.trigger(a, c, this.handle.elem)
                    })
                }
                if (!e || e.nodeType === 3 || e.nodeType === 8) return r;
                a.result = r;
                a.target = e;
                c = b.makeArray(c);
                c.unshift(a)
            }
            a.currentTarget = e;
            (g = b.data(e, "handle")) && g.apply(e, c);
            g = e.parentNode || e.ownerDocument;
            try {
                if (!(e && e.nodeName && b.noData[e.nodeName.toLowerCase()])) if (e["on" + f] && e["on" + f].apply(e, c) === false) a.result = false
            } catch (l) {}
            if (!a.isPropagationStopped() && g) b.event.trigger(a, c, g, true);
            else if (!a.isDefaultPrevented()) {
                g = a.target;
                var n, x = b.nodeName(g, "a") && f === "click",
                    s = b.event.special[f] || {};
                if ((!s._default || s._default.call(e, a) === false) && !x && !(g && g.nodeName && b.noData[g.nodeName.toLowerCase()])) {
                    try {
                        if (g[f]) {
                            if (n = g["on" + f]) g["on" + f] = null;
                            b.event.triggered = true;
                            g[f]()
                        }
                    } catch (y) {}
                    if (n) g["on" + f] = n;
                    b.event.triggered = false
                }
            }
        },
        handle: function (a) {
            var c, e, g, f;
            a = arguments[0] = b.event.fix(a || j.event);
            a.currentTarget = this;
            c = a.type.indexOf(".") < 0 && !a.exclusive;
            if (!c) {
                e = a.type.split(".");
                a.type = e.shift();
                g = RegExp("(^|\\.)" + e.slice(0).sort().join("\\.(?:.*\\.)?") + "(\\.|$)")
            }
            f = b.data(this, "events");
            e = f[a.type];
            if (f && e) {
                e = e.slice(0);
                f = 0;
                for (var l = e.length; f < l; f++) {
                    var n = e[f];
                    if (c || g.test(n.namespace)) {
                        a.handler = n.handler;
                        a.data = n.data;
                        a.handleObj = n;
                        n = n.handler.apply(this, arguments);
                        if (n !== r) {
                            a.result = n;
                            if (n === false) {
                                a.preventDefault();
                                a.stopPropagation()
                            }
                        }
                        if (a.isImmediatePropagationStopped()) break
                    }
                }
            }
            return a.result
        },
        props: "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
        fix: function (a) {
            if (a[$]) return a;
            var c = a;
            a = b.Event(c);
            for (var e = this.props.length, g; e;) {
                g = this.props[--e];
                a[g] = c[g]
            }
            if (!a.target) a.target = a.srcElement || d;
            if (a.target.nodeType === 3) a.target = a.target.parentNode;
            if (!a.relatedTarget && a.fromElement) a.relatedTarget = a.fromElement === a.target ? a.toElement : a.fromElement;
            if (a.pageX == null && a.clientX != null) {
                c = d.documentElement;
                e = d.body;
                a.pageX = a.clientX + (c && c.scrollLeft || e && e.scrollLeft || 0) - (c && c.clientLeft || e && e.clientLeft || 0);
                a.pageY = a.clientY + (c && c.scrollTop || e && e.scrollTop || 0) - (c && c.clientTop || e && e.clientTop || 0)
            }
            if (!a.which && (a.charCode || a.charCode === 0 ? a.charCode : a.keyCode)) a.which = a.charCode || a.keyCode;
            if (!a.metaKey && a.ctrlKey) a.metaKey = a.ctrlKey;
            if (!a.which && a.button !== r) a.which = a.button & 1 ? 1 : a.button & 2 ? 3 : a.button & 4 ? 2 : 0;
            return a
        },
        guid: 1E8,
        proxy: b.proxy,
        special: {
            ready: {
                setup: b.bindReady,
                teardown: b.noop
            },
            live: {
                add: function (a) {
                    b.event.add(this, a.origType, b.extend({}, a, {
                        handler: Z
                    }))
                },
                remove: function (a) {
                    var c = true,
                        e = a.origType.replace(sa, "");
                    b.each(b.data(this, "events").live || [], function () {
                        if (e === this.origType.replace(sa, "")) return c = false
                    });
                    c && b.event.remove(this, a.origType, Z)
                }
            },
            beforeunload: {
                setup: function (a, c, e) {
                    if (this.setInterval) this.onbeforeunload = e;
                    return false
                },
                teardown: function (a, c) {
                    if (this.onbeforeunload === c) this.onbeforeunload = null
                }
            }
        }
    };
    var La = d.removeEventListener ?
    function (a, c, e) {
        a.removeEventListener(c, e, false)
    } : function (a, c, e) {
        a.detachEvent("on" + c, e)
    };
    b.Event = function (a) {
        if (!this.preventDefault) return new b.Event(a);
        if (a && a.type) {
            this.originalEvent = a;
            this.type = a.type
        } else this.type = a;
        this.timeStamp = I();
        this[$] = true
    };
    b.Event.prototype = {
        preventDefault: function () {
            this.isDefaultPrevented = W;
            var a = this.originalEvent;
            if (a) {
                a.preventDefault && a.preventDefault();
                a.returnValue = false
            }
        },
        stopPropagation: function () {
            this.isPropagationStopped = W;
            var a = this.originalEvent;
            if (a) {
                a.stopPropagation && a.stopPropagation();
                a.cancelBubble = true
            }
        },
        stopImmediatePropagation: function () {
            this.isImmediatePropagationStopped = W;
            this.stopPropagation()
        },
        isDefaultPrevented: V,
        isPropagationStopped: V,
        isImmediatePropagationStopped: V
    };
    var Ma = function (a) {
            var c = a.relatedTarget;
            try {
                for (; c && c !== this;) c = c.parentNode;
                if (c !== this) {
                    a.type = a.data;
                    b.event.handle.apply(this, arguments)
                }
            } catch (e) {}
        },
        Na = function (a) {
            a.type = a.data;
            b.event.handle.apply(this, arguments)
        };
    b.each({
        mouseenter: "mouseover",
        mouseleave: "mouseout"
    }, function (a, c) {
        b.event.special[a] = {
            setup: function (e) {
                b.event.add(this, c, e && e.selector ? Na : Ma, a)
            },
            teardown: function (e) {
                b.event.remove(this, c, e && e.selector ? Na : Ma)
            }
        }
    });
    if (!b.support.submitBubbles) b.event.special.submit = {
        setup: function () {
            if (this.nodeName.toLowerCase() !== "form") {
                b.event.add(this, "click.specialSubmit", function (a) {
                    var c = a.target,
                        e = c.type;
                    if ((e === "submit" || e === "image") && b(c).closest("form").length) return M("submit", this, arguments)
                });
                b.event.add(this, "keypress.specialSubmit", function (a) {
                    var c = a.target,
                        e = c.type;
                    if ((e === "text" || e === "password") && b(c).closest("form").length && a.keyCode === 13) return M("submit", this, arguments)
                })
            } else return false
        },
        teardown: function () {
            b.event.remove(this, ".specialSubmit")
        }
    };
    if (!b.support.changeBubbles) {
        var ya = /textarea|input|select/i,
            za, Oa = function (a) {
                var c = a.type,
                    e = a.value;
                if (c === "radio" || c === "checkbox") e = a.checked;
                else if (c === "select-multiple") e = a.selectedIndex > -1 ? b.map(a.options, function (g) {
                    return g.selected
                }).join("-") : "";
                else if (a.nodeName.toLowerCase() === "select") e = a.selectedIndex;
                return e
            },
            Aa = function (a, c) {
                var e = a.target,
                    g, f;
                if (!(!ya.test(e.nodeName) || e.readOnly)) {
                    g = b.data(e, "_change_data");
                    f = Oa(e);
                    if (a.type !== "focusout" || e.type !== "radio") b.data(e, "_change_data", f);
                    if (!(g === r || f === g)) if (g != null || f) {
                        a.type = "change";
                        return b.event.trigger(a, c, e)
                    }
                }
            };
        b.event.special.change = {
            filters: {
                focusout: Aa,
                click: function (a) {
                    var c = a.target,
                        e = c.type;
                    if (e === "radio" || e === "checkbox" || c.nodeName.toLowerCase() === "select") return Aa.call(this, a)
                },
                keydown: function (a) {
                    var c = a.target,
                        e = c.type;
                    if (a.keyCode === 13 && c.nodeName.toLowerCase() !== "textarea" || a.keyCode === 32 && (e === "checkbox" || e === "radio") || e === "select-multiple") return Aa.call(this, a)
                },
                beforeactivate: function (a) {
                    a = a.target;
                    b.data(a, "_change_data", Oa(a))
                }
            },
            setup: function () {
                if (this.type === "file") return false;
                for (var a in za) b.event.add(this, a + ".specialChange", za[a]);
                return ya.test(this.nodeName)
            },
            teardown: function () {
                b.event.remove(this, ".specialChange");
                return ya.test(this.nodeName)
            }
        };
        za = b.event.special.change.filters
    }
    d.addEventListener && b.each({
        focus: "focusin",
        blur: "focusout"
    }, function (a, c) {
        function e(g) {
            g = b.event.fix(g);
            g.type = c;
            return b.event.handle.call(this, g)
        }
        b.event.special[c] = {
            setup: function () {
                this.addEventListener(a, e, true)
            },
            teardown: function () {
                this.removeEventListener(a, e, true)
            }
        }
    });
    b.each(["bind", "one"], function (a, c) {
        b.fn[c] = function (e, g, f) {
            if (typeof e === "object") {
                for (var l in e) this[c](l, g, e[l], f);
                return this
            }
            if (b.isFunction(g)) {
                f = g;
                g = r
            }
            var n = c === "one" ? b.proxy(f, function (s) {
                b(this).unbind(s, n);
                return f.apply(this, arguments)
            }) : f;
            if (e === "unload" && c !== "one") this.one(e, g, f);
            else {
                l = 0;
                for (var x = this.length; l < x; l++) b.event.add(this[l], e, n, g)
            }
            return this
        }
    });
    b.fn.extend({
        unbind: function (a, c) {
            if (typeof a === "object" && !a.preventDefault) for (var e in a) this.unbind(e, a[e]);
            else {
                e = 0;
                for (var g = this.length; e < g; e++) b.event.remove(this[e], a, c)
            }
            return this
        },
        delegate: function (a, c, e, g) {
            return this.live(c, e, g, a)
        },
        undelegate: function (a, c, e) {
            return arguments.length === 0 ? this.unbind("live") : this.die(c, null, e, a)
        },
        trigger: function (a, c) {
            return this.each(function () {
                b.event.trigger(a, c, this)
            })
        },
        triggerHandler: function (a, c) {
            if (this[0]) {
                a = b.Event(a);
                a.preventDefault();
                a.stopPropagation();
                b.event.trigger(a, c, this[0]);
                return a.result
            }
        },
        toggle: function (a) {
            for (var c = arguments, e = 1; e < c.length;) b.proxy(a, c[e++]);
            return this.click(b.proxy(a, function (g) {
                var f = (b.data(this, "lastToggle" + a.guid) || 0) % e;
                b.data(this, "lastToggle" + a.guid, f + 1);
                g.preventDefault();
                return c[f].apply(this, arguments) || false
            }))
        },
        hover: function (a, c) {
            return this.mouseenter(a).mouseleave(c || a)
        }
    });
    var Pa = {
        focus: "focusin",
        blur: "focusout",
        mouseenter: "mouseover",
        mouseleave: "mouseout"
    };
    b.each(["live", "die"], function (a, c) {
        b.fn[c] = function (e, g, f, l) {
            var n, x = 0,
                s, y, D = l || this.selector,
                S = l ? this : b(this.context);
            if (b.isFunction(g)) {
                f = g;
                g = r
            }
            for (e = (e || "").split(" ");
            (n = e[x++]) != null;) {
                l = sa.exec(n);
                s = "";
                if (l) {
                    s = l[0];
                    n = n.replace(sa, "")
                }
                if (n === "hover") e.push("mouseenter" + s, "mouseleave" + s);
                else {
                    y = n;
                    if (n === "focus" || n === "blur") {
                        e.push(Pa[n] + s);
                        n += s
                    } else n = (Pa[n] || n) + s;
                    c === "live" ? S.each(function () {
                        b.event.add(this, ga(n, D), {
                            data: g,
                            selector: D,
                            handler: f,
                            origType: n,
                            origHandler: f,
                            preType: y
                        })
                    }) : S.unbind(ga(n, D), f)
                }
            }
            return this
        }
    });
    b.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "), function (a, c) {
        b.fn[c] = function (e) {
            return e ? this.bind(c, e) : this.trigger(c)
        };
        if (b.attrFn) b.attrFn[c] = true
    });
    j.attachEvent && !j.addEventListener && j.attachEvent("onunload", function () {
        for (var a in b.cache) if (b.cache[a].handle) try {
            b.event.remove(b.cache[a].handle.elem)
        } catch (c) {}
    });
    (function () {
        function a(h) {
            for (var k = "", q, w = 0; h[w]; w++) {
                q = h[w];
                if (q.nodeType === 3 || q.nodeType === 4) k += q.nodeValue;
                else if (q.nodeType !== 8) k += a(q.childNodes)
            }
            return k
        }
        function c(h, k, q, w, B, A) {
            B = 0;
            for (var Q = w.length; B < Q; B++) {
                var N = w[B];
                if (N) {
                    N = N[h];
                    for (var X = false; N;) {
                        if (N.sizcache === q) {
                            X = w[N.sizset];
                            break
                        }
                        if (N.nodeType === 1 && !A) {
                            N.sizcache = q;
                            N.sizset = B
                        }
                        if (N.nodeName.toLowerCase() === k) {
                            X = N;
                            break
                        }
                        N = N[h]
                    }
                    w[B] = X
                }
            }
        }
        function e(h, k, q, w, B, A) {
            B = 0;
            for (var Q = w.length; B < Q; B++) {
                var N = w[B];
                if (N) {
                    N = N[h];
                    for (var X = false; N;) {
                        if (N.sizcache === q) {
                            X = w[N.sizset];
                            break
                        }
                        if (N.nodeType === 1) {
                            if (!A) {
                                N.sizcache = q;
                                N.sizset = B
                            }
                            if (typeof k !== "string") {
                                if (N === k) {
                                    X = true;
                                    break
                                }
                            } else if (s.filter(k, [N]).length > 0) {
                                X = N;
                                break
                            }
                        }
                        N = N[h]
                    }
                    w[B] = X
                }
            }
        }
        var g = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
            f = 0,
            l = Object.prototype.toString,
            n = false,
            x = true;
        [0, 0].sort(function () {
            x = false;
            return 0
        });
        var s = function (h, k, q, w) {
                q = q || [];
                var B = k = k || d;
                if (k.nodeType !== 1 && k.nodeType !== 9) return [];
                if (!h || typeof h !== "string") return q;
                for (var A = [], Q, N, X, ta, ma = true, qa = U(k), na = h;
                (g.exec(""), Q = g.exec(na)) !== null;) {
                    na = Q[3];
                    A.push(Q[1]);
                    if (Q[2]) {
                        ta = Q[3];
                        break
                    }
                }
                if (A.length > 1 && D.exec(h)) if (A.length === 2 && y.relative[A[0]]) N = Ba(A[0] + A[1], k);
                else for (N = y.relative[A[0]] ? [k] : s(A.shift(), k); A.length;) {
                    h = A.shift();
                    if (y.relative[h]) h += A.shift();
                    N = Ba(h, N)
                } else {
                    if (!w && A.length > 1 && k.nodeType === 9 && !qa && y.match.ID.test(A[0]) && !y.match.ID.test(A[A.length - 1])) {
                        Q = s.find(A.shift(), k, qa);
                        k = Q.expr ? s.filter(Q.expr, Q.set)[0] : Q.set[0]
                    }
                    if (k) {
                        Q = w ? {
                            expr: A.pop(),
                            set: Y(w)
                        } : s.find(A.pop(), A.length === 1 && (A[0] === "~" || A[0] === "+") && k.parentNode ? k.parentNode : k, qa);
                        N = Q.expr ? s.filter(Q.expr, Q.set) : Q.set;
                        if (A.length > 0) X = Y(N);
                        else ma = false;
                        for (; A.length;) {
                            var ha = A.pop();
                            Q = ha;
                            if (y.relative[ha]) Q = A.pop();
                            else ha = "";
                            if (Q == null) Q = k;
                            y.relative[ha](X, Q, qa)
                        }
                    } else X = []
                }
                X || (X = N);
                X || s.error(ha || h);
                if (l.call(X) === "[object Array]") if (ma) if (k && k.nodeType === 1) for (h = 0; X[h] != null; h++) {
                    if (X[h] && (X[h] === true || X[h].nodeType === 1 && ia(k, X[h]))) q.push(N[h])
                } else for (h = 0; X[h] != null; h++) X[h] && X[h].nodeType === 1 && q.push(N[h]);
                else q.push.apply(q, X);
                else Y(X, q);
                if (ta) {
                    s(ta, B, q, w);
                    s.uniqueSort(q)
                }
                return q
            };
        s.uniqueSort = function (h) {
            if (aa) {
                n = x;
                h.sort(aa);
                if (n) for (var k = 1; k < h.length; k++) h[k] === h[k - 1] && h.splice(k--, 1)
            }
            return h
        };
        s.matches = function (h, k) {
            return s(h, null, null, k)
        };
        s.find = function (h, k, q) {
            var w, B;
            if (!h) return [];
            for (var A = 0, Q = y.order.length; A < Q; A++) {
                var N = y.order[A];
                if (B = y.leftMatch[N].exec(h)) {
                    var X = B[1];
                    B.splice(1, 1);
                    if (X.substr(X.length - 1) !== "\\") {
                        B[1] = (B[1] || "").replace(/\\/g, "");
                        w = y.find[N](B, k, q);
                        if (w != null) {
                            h = h.replace(y.match[N], "");
                            break
                        }
                    }
                }
            }
            w || (w = k.getElementsByTagName("*"));
            return {
                set: w,
                expr: h
            }
        };
        s.filter = function (h, k, q, w) {
            for (var B = h, A = [], Q = k, N, X, ta = k && k[0] && U(k[0]); h && k.length;) {
                for (var ma in y.filter) if ((N = y.leftMatch[ma].exec(h)) != null && N[2]) {
                    var qa = y.filter[ma],
                        na, ha;
                    ha = N[1];
                    X = false;
                    N.splice(1, 1);
                    if (ha.substr(ha.length - 1) !== "\\") {
                        if (Q === A) A = [];
                        if (y.preFilter[ma]) if (N = y.preFilter[ma](N, Q, q, A, w, ta)) {
                            if (N === true) continue
                        } else X = na = true;
                        if (N) for (var ua = 0;
                        (ha = Q[ua]) != null; ua++) if (ha) {
                            na = qa(ha, N, ua, Q);
                            var Qa = w ^ !! na;
                            if (q && na != null) if (Qa) X = true;
                            else Q[ua] = false;
                            else if (Qa) {
                                A.push(ha);
                                X = true
                            }
                        }
                        if (na !== r) {
                            q || (Q = A);
                            h = h.replace(y.match[ma], "");
                            if (!X) return [];
                            break
                        }
                    }
                }
                if (h === B) if (X == null) s.error(h);
                else break;
                B = h
            }
            return Q
        };
        s.error = function (h) {
            throw "Syntax error, unrecognized expression: " + h;
        };
        var y = s.selectors = {
            order: ["ID", "NAME", "TAG"],
            match: {
                ID: /#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,
                CLASS: /\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,
                NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,
                ATTR: /\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,
                TAG: /^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,
                CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,
                POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,
                PSEUDO: /:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/
            },
            leftMatch: {},
            attrMap: {
                "class": "className",
                "for": "htmlFor"
            },
            attrHandle: {
                href: function (h) {
                    return h.getAttribute("href")
                }
            },
            relative: {
                "+": function (h, k) {
                    var q = typeof k === "string",
                        w = q && !/\W/.test(k);
                    q = q && !w;
                    if (w) k = k.toLowerCase();
                    w = 0;
                    for (var B = h.length, A; w < B; w++) if (A = h[w]) {
                        for (;
                        (A = A.previousSibling) && A.nodeType !== 1;);
                        h[w] = q || A && A.nodeName.toLowerCase() === k ? A || false : A === k
                    }
                    q && s.filter(k, h, true)
                },
                ">": function (h, k) {
                    var q = typeof k === "string";
                    if (q && !/\W/.test(k)) {
                        k = k.toLowerCase();
                        for (var w = 0, B = h.length; w < B; w++) {
                            var A = h[w];
                            if (A) {
                                q = A.parentNode;
                                h[w] = q.nodeName.toLowerCase() === k ? q : false
                            }
                        }
                    } else {
                        w = 0;
                        for (B = h.length; w < B; w++) if (A = h[w]) h[w] = q ? A.parentNode : A.parentNode === k;
                        q && s.filter(k, h, true)
                    }
                },
                "": function (h, k, q) {
                    var w = f++,
                        B = e;
                    if (typeof k === "string" && !/\W/.test(k)) {
                        var A = k = k.toLowerCase();
                        B = c
                    }
                    B("parentNode", k, w, h, A, q)
                },
                "~": function (h, k, q) {
                    var w = f++,
                        B = e;
                    if (typeof k === "string" && !/\W/.test(k)) {
                        var A = k = k.toLowerCase();
                        B = c
                    }
                    B("previousSibling", k, w, h, A, q)
                }
            },
            find: {
                ID: function (h, k, q) {
                    if (typeof k.getElementById !== "undefined" && !q) return (h = k.getElementById(h[1])) ? [h] : []
                },
                NAME: function (h, k) {
                    if (typeof k.getElementsByName !== "undefined") {
                        var q = [];
                        k = k.getElementsByName(h[1]);
                        for (var w = 0, B = k.length; w < B; w++) k[w].getAttribute("name") === h[1] && q.push(k[w]);
                        return q.length === 0 ? null : q
                    }
                },
                TAG: function (h, k) {
                    return k.getElementsByTagName(h[1])
                }
            },
            preFilter: {
                CLASS: function (h, k, q, w, B, A) {
                    h = " " + h[1].replace(/\\/g, "") + " ";
                    if (A) return h;
                    A = 0;
                    for (var Q;
                    (Q = k[A]) != null; A++) if (Q) if (B ^ (Q.className && (" " + Q.className + " ").replace(/[\t\n]/g, " ").indexOf(h) >= 0)) q || w.push(Q);
                    else if (q) k[A] = false;
                    return false
                },
                ID: function (h) {
                    return h[1].replace(/\\/g, "")
                },
                TAG: function (h) {
                    return h[1].toLowerCase()
                },
                CHILD: function (h) {
                    if (h[1] === "nth") {
                        var k = /(-?)(\d*)n((?:\+|-)?\d*)/.exec(h[2] === "even" && "2n" || h[2] === "odd" && "2n+1" || !/\D/.test(h[2]) && "0n+" + h[2] || h[2]);
                        h[2] = k[1] + (k[2] || 1) - 0;
                        h[3] = k[3] - 0
                    }
                    h[0] = f++;
                    return h
                },
                ATTR: function (h, k, q, w, B, A) {
                    k = h[1].replace(/\\/g, "");
                    if (!A && y.attrMap[k]) h[1] = y.attrMap[k];
                    if (h[2] === "~=") h[4] = " " + h[4] + " ";
                    return h
                },
                PSEUDO: function (h, k, q, w, B) {
                    if (h[1] === "not") if ((g.exec(h[3]) || "").length > 1 || /^\w/.test(h[3])) h[3] = s(h[3], null, null, k);
                    else {
                        h = s.filter(h[3], k, q, true ^ B);
                        q || w.push.apply(w, h);
                        return false
                    } else if (y.match.POS.test(h[0]) || y.match.CHILD.test(h[0])) return true;
                    return h
                },
                POS: function (h) {
                    h.unshift(true);
                    return h
                }
            },
            filters: {
                enabled: function (h) {
                    return h.disabled === false && h.type !== "hidden"
                },
                disabled: function (h) {
                    return h.disabled === true
                },
                checked: function (h) {
                    return h.checked === true
                },
                selected: function (h) {
                    return h.selected === true
                },
                parent: function (h) {
                    return !!h.firstChild
                },
                empty: function (h) {
                    return !h.firstChild
                },
                has: function (h, k, q) {
                    return !!s(q[3], h).length
                },
                header: function (h) {
                    return /h\d/i.test(h.nodeName)
                },
                text: function (h) {
                    return "text" === h.type
                },
                radio: function (h) {
                    return "radio" === h.type
                },
                checkbox: function (h) {
                    return "checkbox" === h.type
                },
                file: function (h) {
                    return "file" === h.type
                },
                password: function (h) {
                    return "password" === h.type
                },
                submit: function (h) {
                    return "submit" === h.type
                },
                image: function (h) {
                    return "image" === h.type
                },
                reset: function (h) {
                    return "reset" === h.type
                },
                button: function (h) {
                    return "button" === h.type || h.nodeName.toLowerCase() === "button"
                },
                input: function (h) {
                    return /input|select|textarea|button/i.test(h.nodeName)
                }
            },
            setFilters: {
                first: function (h, k) {
                    return k === 0
                },
                last: function (h, k, q, w) {
                    return k === w.length - 1
                },
                even: function (h, k) {
                    return k % 2 === 0
                },
                odd: function (h, k) {
                    return k % 2 === 1
                },
                lt: function (h, k, q) {
                    return k < q[3] - 0
                },
                gt: function (h, k, q) {
                    return k > q[3] - 0
                },
                nth: function (h, k, q) {
                    return q[3] - 0 === k
                },
                eq: function (h, k, q) {
                    return q[3] - 0 === k
                }
            },
            filter: {
                PSEUDO: function (h, k, q, w) {
                    var B = k[1],
                        A = y.filters[B];
                    if (A) return A(h, q, k, w);
                    else if (B === "contains") return (h.textContent || h.innerText || a([h]) || "").indexOf(k[3]) >= 0;
                    else if (B === "not") {
                        k = k[3];
                        q = 0;
                        for (w = k.length; q < w; q++) if (k[q] === h) return false;
                        return true
                    } else s.error("Syntax error, unrecognized expression: " + B)
                },
                CHILD: function (h, k) {
                    var q = k[1],
                        w = h;
                    switch (q) {
                    case "only":
                    case "first":
                        for (; w = w.previousSibling;) if (w.nodeType === 1) return false;
                        if (q === "first") return true;
                        w = h;
                    case "last":
                        for (; w = w.nextSibling;) if (w.nodeType === 1) return false;
                        return true;
                    case "nth":
                        q = k[2];
                        var B = k[3];
                        if (q === 1 && B === 0) return true;
                        k = k[0];
                        var A = h.parentNode;
                        if (A && (A.sizcache !== k || !h.nodeIndex)) {
                            var Q = 0;
                            for (w = A.firstChild; w; w = w.nextSibling) if (w.nodeType === 1) w.nodeIndex = ++Q;
                            A.sizcache = k
                        }
                        h = h.nodeIndex - B;
                        return q === 0 ? h === 0 : h % q === 0 && h / q >= 0
                    }
                },
                ID: function (h, k) {
                    return h.nodeType === 1 && h.getAttribute("id") === k
                },
                TAG: function (h, k) {
                    return k === "*" && h.nodeType === 1 || h.nodeName.toLowerCase() === k
                },
                CLASS: function (h, k) {
                    return (" " + (h.className || h.getAttribute("class")) + " ").indexOf(k) > -1
                },
                ATTR: function (h, k) {
                    var q = k[1];
                    h = y.attrHandle[q] ? y.attrHandle[q](h) : h[q] != null ? h[q] : h.getAttribute(q);
                    q = h + "";
                    var w = k[2];
                    k = k[4];
                    return h == null ? w === "!=" : w === "=" ? q === k : w === "*=" ? q.indexOf(k) >= 0 : w === "~=" ? (" " + q + " ").indexOf(k) >= 0 : !k ? q && h !== false : w === "!=" ? q !== k : w === "^=" ? q.indexOf(k) === 0 : w === "$=" ? q.substr(q.length - k.length) === k : w === "|=" ? q === k || q.substr(0, k.length + 1) === k + "-" : false
                },
                POS: function (h, k, q, w) {
                    var B = y.setFilters[k[2]];
                    if (B) return B(h, q, k, w)
                }
            }
        },
            D = y.match.POS,
            S;
        for (S in y.match) {
            y.match[S] = RegExp(y.match[S].source + /(?![^\[]*\])(?![^\(]*\))/.source);
            y.leftMatch[S] = RegExp(/(^(?:.|\r|\n)*?)/.source + y.match[S].source.replace(/\\(\d+)/g, function (h, k) {
                return "\\" + (k - 0 + 1)
            }))
        }
        var Y = function (h, k) {
                h = Array.prototype.slice.call(h, 0);
                if (k) {
                    k.push.apply(k, h);
                    return k
                }
                return h
            };
        try {
            Array.prototype.slice.call(d.documentElement.childNodes, 0)
        } catch (ba) {
            Y = function (h, k) {
                k = k || [];
                if (l.call(h) === "[object Array]") Array.prototype.push.apply(k, h);
                else if (typeof h.length === "number") for (var q = 0, w = h.length; q < w; q++) k.push(h[q]);
                else for (q = 0; h[q]; q++) k.push(h[q]);
                return k
            }
        }
        var aa;
        if (d.documentElement.compareDocumentPosition) aa = function (h, k) {
            if (!h.compareDocumentPosition || !k.compareDocumentPosition) {
                if (h == k) n = true;
                return h.compareDocumentPosition ? -1 : 1
            }
            h = h.compareDocumentPosition(k) & 4 ? -1 : h === k ? 0 : 1;
            if (h === 0) n = true;
            return h
        };
        else if ("sourceIndex" in d.documentElement) aa = function (h, k) {
            if (!h.sourceIndex || !k.sourceIndex) {
                if (h == k) n = true;
                return h.sourceIndex ? -1 : 1
            }
            h = h.sourceIndex - k.sourceIndex;
            if (h === 0) n = true;
            return h
        };
        else if (d.createRange) aa = function (h, k) {
            if (!h.ownerDocument || !k.ownerDocument) {
                if (h == k) n = true;
                return h.ownerDocument ? -1 : 1
            }
            var q = h.ownerDocument.createRange(),
                w = k.ownerDocument.createRange();
            q.setStart(h, 0);
            q.setEnd(h, 0);
            w.setStart(k, 0);
            w.setEnd(k, 0);
            h = q.compareBoundaryPoints(Range.START_TO_END, w);
            if (h === 0) n = true;
            return h
        };
        (function () {
            var h = d.createElement("div"),
                k = "script" + (new Date).getTime();
            h.innerHTML = "<a name='" + k + "'/>";
            var q = d.documentElement;
            q.insertBefore(h, q.firstChild);
            if (d.getElementById(k)) {
                y.find.ID = function (w, B, A) {
                    if (typeof B.getElementById !== "undefined" && !A) return (B = B.getElementById(w[1])) ? B.id === w[1] || typeof B.getAttributeNode !== "undefined" && B.getAttributeNode("id").nodeValue === w[1] ? [B] : r : []
                };
                y.filter.ID = function (w, B) {
                    var A = typeof w.getAttributeNode !== "undefined" && w.getAttributeNode("id");
                    return w.nodeType === 1 && A && A.nodeValue === B
                }
            }
            q.removeChild(h);
            q = h = null
        })();
        (function () {
            var h = d.createElement("div");
            h.appendChild(d.createComment(""));
            if (h.getElementsByTagName("*").length > 0) y.find.TAG = function (k, q) {
                q = q.getElementsByTagName(k[1]);
                if (k[1] === "*") {
                    k = [];
                    for (var w = 0; q[w]; w++) q[w].nodeType === 1 && k.push(q[w]);
                    q = k
                }
                return q
            };
            h.innerHTML = "<a href='#'></a>";
            if (h.firstChild && typeof h.firstChild.getAttribute !== "undefined" && h.firstChild.getAttribute("href") !== "#") y.attrHandle.href = function (k) {
                return k.getAttribute("href", 2)
            };
            h = null
        })();
        d.querySelectorAll &&
        function () {
            var h = s,
                k = d.createElement("div");
            k.innerHTML = "<p class='TEST'></p>";
            if (!(k.querySelectorAll && k.querySelectorAll(".TEST").length === 0)) {
                s = function (w, B, A, Q) {
                    B = B || d;
                    if (!Q && B.nodeType === 9 && !U(B)) try {
                        return Y(B.querySelectorAll(w), A)
                    } catch (N) {}
                    return h(w, B, A, Q)
                };
                for (var q in h) s[q] = h[q];
                k = null
            }
        }();
        (function () {
            var h = d.createElement("div");
            h.innerHTML = "<div class='test e'></div><div class='test'></div>";
            if (!(!h.getElementsByClassName || h.getElementsByClassName("e").length === 0)) {
                h.lastChild.className = "e";
                if (h.getElementsByClassName("e").length !== 1) {
                    y.order.splice(1, 0, "CLASS");
                    y.find.CLASS = function (k, q, w) {
                        if (typeof q.getElementsByClassName !== "undefined" && !w) return q.getElementsByClassName(k[1])
                    };
                    h = null
                }
            }
        })();
        var ia = d.compareDocumentPosition ?
        function (h, k) {
            return !!(h.compareDocumentPosition(k) & 16)
        } : function (h, k) {
            return h !== k && (h.contains ? h.contains(k) : true)
        }, U = function (h) {
            return (h = (h ? h.ownerDocument || h : 0).documentElement) ? h.nodeName !== "HTML" : false
        }, Ba = function (h, k) {
            var q = [],
                w = "",
                B;
            for (k = k.nodeType ? [k] : k; B = y.match.PSEUDO.exec(h);) {
                w += B[0];
                h = h.replace(y.match.PSEUDO, "")
            }
            h = y.relative[h] ? h + "*" : h;
            B = 0;
            for (var A = k.length; B < A; B++) s(h, k[B], q);
            return s.filter(w, q)
        };
        b.find = s;
        b.expr = s.selectors;
        b.expr[":"] = b.expr.filters;
        b.unique = s.uniqueSort;
        b.text = a;
        b.isXMLDoc = U;
        b.contains = ia
    })();
    var eb = /Until$/,
        fb = /^(?:parents|prevUntil|prevAll)/,
        gb = /,/;
    R = Array.prototype.slice;
    var Ra = function (a, c, e) {
            if (b.isFunction(c)) return b.grep(a, function (f, l) {
                return !!c.call(f, l, f) === e
            });
            else if (c.nodeType) return b.grep(a, function (f) {
                return f === c === e
            });
            else if (typeof c === "string") {
                var g = b.grep(a, function (f) {
                    return f.nodeType === 1
                });
                if (o.test(c)) return b.filter(c, g, !e);
                else c = b.filter(c, g)
            }
            return b.grep(a, function (f) {
                return b.inArray(f, c) >= 0 === e
            })
        };
    b.fn.extend({
        find: function (a) {
            for (var c = this.pushStack("", "find", a), e = 0, g = 0, f = this.length; g < f; g++) {
                e = c.length;
                b.find(a, this[g], c);
                if (g > 0) for (var l = e; l < c.length; l++) for (var n = 0; n < e; n++) if (c[n] === c[l]) {
                    c.splice(l--, 1);
                    break
                }
            }
            return c
        },
        has: function (a) {
            var c = b(a);
            return this.filter(function () {
                for (var e = 0, g = c.length; e < g; e++) if (b.contains(this, c[e])) return true
            })
        },
        not: function (a) {
            return this.pushStack(Ra(this, a, false), "not", a)
        },
        filter: function (a) {
            return this.pushStack(Ra(this, a, true), "filter", a)
        },
        is: function (a) {
            return !!a && b.filter(a, this).length > 0
        },
        closest: function (a, c) {
            if (b.isArray(a)) {
                var e = [],
                    g = this[0],
                    f, l = {},
                    n;
                if (g && a.length) {
                    f = 0;
                    for (var x = a.length; f < x; f++) {
                        n = a[f];
                        l[n] || (l[n] = b.expr.match.POS.test(n) ? b(n, c || this.context) : n)
                    }
                    for (; g && g.ownerDocument && g !== c;) {
                        for (n in l) {
                            f = l[n];
                            if (f.jquery ? f.index(g) > -1 : b(g).is(f)) {
                                e.push({
                                    selector: n,
                                    elem: g
                                });
                                delete l[n]
                            }
                        }
                        g = g.parentNode
                    }
                }
                return e
            }
            var s = b.expr.match.POS.test(a) ? b(a, c || this.context) : null;
            return this.map(function (y, D) {
                for (; D && D.ownerDocument && D !== c;) {
                    if (s ? s.index(D) > -1 : b(D).is(a)) return D;
                    D = D.parentNode
                }
                return null
            })
        },
        index: function (a) {
            if (!a || typeof a === "string") return b.inArray(this[0], a ? b(a) : this.parent().children());
            return b.inArray(a.jquery ? a[0] : a, this)
        },
        add: function (a, c) {
            a = typeof a === "string" ? b(a, c || this.context) : b.makeArray(a);
            c = b.merge(this.get(), a);
            return this.pushStack(!a[0] || !a[0].parentNode || a[0].parentNode.nodeType === 11 || !c[0] || !c[0].parentNode || c[0].parentNode.nodeType === 11 ? c : b.unique(c))
        },
        andSelf: function () {
            return this.add(this.prevObject)
        }
    });
    b.each({
        parent: function (a) {
            return (a = a.parentNode) && a.nodeType !== 11 ? a : null
        },
        parents: function (a) {
            return b.dir(a, "parentNode")
        },
        parentsUntil: function (a, c, e) {
            return b.dir(a, "parentNode", e)
        },
        next: function (a) {
            return b.nth(a, 2, "nextSibling")
        },
        prev: function (a) {
            return b.nth(a, 2, "previousSibling")
        },
        nextAll: function (a) {
            return b.dir(a, "nextSibling")
        },
        prevAll: function (a) {
            return b.dir(a, "previousSibling")
        },
        nextUntil: function (a, c, e) {
            return b.dir(a, "nextSibling", e)
        },
        prevUntil: function (a, c, e) {
            return b.dir(a, "previousSibling", e)
        },
        siblings: function (a) {
            return b.sibling(a.parentNode.firstChild, a)
        },
        children: function (a) {
            return b.sibling(a.firstChild)
        },
        contents: function (a) {
            return b.nodeName(a, "iframe") ? a.contentDocument || a.contentWindow.document : b.makeArray(a.childNodes)
        }
    }, function (a, c) {
        b.fn[a] = function (e, g) {
            var f = b.map(this, c, e);
            eb.test(a) || (g = e);
            if (g && typeof g === "string") f = b.filter(g, f);
            f = this.length > 1 ? b.unique(f) : f;
            if ((this.length > 1 || gb.test(g)) && fb.test(a)) f = f.reverse();
            return this.pushStack(f, a, R.call(arguments).join(","))
        }
    });
    b.extend({
        filter: function (a, c, e) {
            if (e) a = ":not(" + a + ")";
            return b.find.matches(a, c)
        },
        dir: function (a, c, e) {
            var g = [];
            for (a = a[c]; a && a.nodeType !== 9 && (e === r || a.nodeType !== 1 || !b(a).is(e));) {
                a.nodeType === 1 && g.push(a);
                a = a[c]
            }
            return g
        },
        nth: function (a, c, e) {
            c = c || 1;
            for (var g = 0; a; a = a[e]) if (a.nodeType === 1 && ++g === c) break;
            return a
        },
        sibling: function (a, c) {
            for (var e = []; a; a = a.nextSibling) a.nodeType === 1 && a !== c && e.push(a);
            return e
        }
    });
    var Sa = / jQuery\d+="(?:\d+|null)"/g,
        va = /^\s+/,
        Ta = /(<([\w:]+)[^>]*?)\/>/g,
        hb = /^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,
        Ua = /<([\w:]+)/,
        ib = /<tbody/i,
        jb = /<|&#?\w+;/,
        Ha = /<script|<object|<embed|<option|<style/i,
        Ia = /checked\s*(?:[^=]|=\s*.checked.)/i,
        Va = function (a, c, e) {
            return hb.test(e) ? a : c + "></" + e + ">"
        },
        ja = {
            option: [1, "<select multiple='multiple'>", "</select>"],
            legend: [1, "<fieldset>", "</fieldset>"],
            thead: [1, "<table>", "</table>"],
            tr: [2, "<table><tbody>", "</tbody></table>"],
            td: [3, "<table><tbody><tr>", "</tr></tbody></table>"],
            col: [2, "<table><tbody></tbody><colgroup>", "</colgroup></table>"],
            area: [1, "<map>", "</map>"],
            _default: [0, "", ""]
        };
    ja.optgroup = ja.option;
    ja.tbody = ja.tfoot = ja.colgroup = ja.caption = ja.thead;
    ja.th = ja.td;
    if (!b.support.htmlSerialize) ja._default = [1, "div<div>", "</div>"];
    b.fn.extend({
        text: function (a) {
            if (b.isFunction(a)) return this.each(function (c) {
                var e = b(this);
                e.text(a.call(this, c, e.text()))
            });
            if (typeof a !== "object" && a !== r) return this.empty().append((this[0] && this[0].ownerDocument || d).createTextNode(a));
            return b.text(this)
        },
        wrapAll: function (a) {
            if (b.isFunction(a)) return this.each(function (e) {
                b(this).wrapAll(a.call(this, e))
            });
            if (this[0]) {
                var c = b(a, this[0].ownerDocument).eq(0).clone(true);
                this[0].parentNode && c.insertBefore(this[0]);
                c.map(function () {
                    for (var e = this; e.firstChild && e.firstChild.nodeType === 1;) e = e.firstChild;
                    return e
                }).append(this)
            }
            return this
        },
        wrapInner: function (a) {
            if (b.isFunction(a)) return this.each(function (c) {
                b(this).wrapInner(a.call(this, c))
            });
            return this.each(function () {
                var c = b(this),
                    e = c.contents();
                e.length ? e.wrapAll(a) : c.append(a)
            })
        },
        wrap: function (a) {
            return this.each(function () {
                b(this).wrapAll(a)
            })
        },
        unwrap: function () {
            return this.parent().each(function () {
                b.nodeName(this, "body") || b(this).replaceWith(this.childNodes)
            }).end()
        },
        append: function () {
            return this.domManip(arguments, true, function (a) {
                this.nodeType === 1 && this.appendChild(a)
            })
        },
        prepend: function () {
            return this.domManip(arguments, true, function (a) {
                this.nodeType === 1 && this.insertBefore(a, this.firstChild)
            })
        },
        before: function () {
            if (this[0] && this[0].parentNode) return this.domManip(arguments, false, function (c) {
                this.parentNode.insertBefore(c, this)
            });
            else if (arguments.length) {
                var a = b(arguments[0]);
                a.push.apply(a, this.toArray());
                return this.pushStack(a, "before", arguments)
            }
        },
        after: function () {
            if (this[0] && this[0].parentNode) return this.domManip(arguments, false, function (c) {
                this.parentNode.insertBefore(c, this.nextSibling)
            });
            else if (arguments.length) {
                var a = this.pushStack(this, "after", arguments);
                a.push.apply(a, b(arguments[0]).toArray());
                return a
            }
        },
        remove: function (a, c) {
            for (var e = 0, g;
            (g = this[e]) != null; e++) if (!a || b.filter(a, [g]).length) {
                if (!c && g.nodeType === 1) {
                    b.cleanData(g.getElementsByTagName("*"));
                    b.cleanData([g])
                }
                g.parentNode && g.parentNode.removeChild(g)
            }
            return this
        },
        empty: function () {
            for (var a = 0, c;
            (c = this[a]) != null; a++) for (c.nodeType === 1 && b.cleanData(c.getElementsByTagName("*")); c.firstChild;) c.removeChild(c.firstChild);
            return this
        },
        clone: function (a) {
            var c = this.map(function () {
                if (!b.support.noCloneEvent && !b.isXMLDoc(this)) {
                    var e = this.outerHTML,
                        g = this.ownerDocument;
                    if (!e) {
                        e = g.createElement("div");
                        e.appendChild(this.cloneNode(true));
                        e = e.innerHTML
                    }
                    return b.clean([e.replace(Sa, "").replace(/=([^="'>\s]+\/)>/g, '="$1">').replace(va, "")], g)[0]
                } else return this.cloneNode(true)
            });
            if (a === true) {
                T(this, c);
                T(this.find("*"), c.find("*"))
            }
            return c
        },
        html: function (a) {
            if (a === r) return this[0] && this[0].nodeType === 1 ? this[0].innerHTML.replace(Sa, "") : null;
            else if (typeof a === "string" && !Ha.test(a) && (b.support.leadingWhitespace || !va.test(a)) && !ja[(Ua.exec(a) || ["", ""])[1].toLowerCase()]) {
                a = a.replace(Ta, Va);
                try {
                    for (var c = 0, e = this.length; c < e; c++) if (this[c].nodeType === 1) {
                        b.cleanData(this[c].getElementsByTagName("*"));
                        this[c].innerHTML = a
                    }
                } catch (g) {
                    this.empty().append(a)
                }
            } else b.isFunction(a) ? this.each(function (f) {
                var l = b(this),
                    n = l.html();
                l.empty().append(function () {
                    return a.call(this, f, n)
                })
            }) : this.empty().append(a);
            return this
        },
        replaceWith: function (a) {
            if (this[0] && this[0].parentNode) {
                if (b.isFunction(a)) return this.each(function (c) {
                    var e = b(this),
                        g = e.html();
                    e.replaceWith(a.call(this, c, g))
                });
                if (typeof a !== "string") a = b(a).detach();
                return this.each(function () {
                    var c = this.nextSibling,
                        e = this.parentNode;
                    b(this).remove();
                    c ? b(c).before(a) : b(e).append(a)
                })
            } else return this.pushStack(b(b.isFunction(a) ? a() : a), "replaceWith", a)
        },
        detach: function (a) {
            return this.remove(a, true)
        },
        domManip: function (a, c, e) {
            var g, f, l = a[0],
                n = [],
                x;
            if (!b.support.checkClone && arguments.length === 3 && typeof l === "string" && Ia.test(l)) return this.each(function () {
                b(this).domManip(a, c, e, true)
            });
            if (b.isFunction(l)) return this.each(function (y) {
                var D = b(this);
                a[0] = l.call(this, y, c ? D.html() : r);
                D.domManip(a, c, e)
            });
            if (this[0]) {
                g = l && l.parentNode;
                g = b.support.parentNode && g && g.nodeType === 11 && g.childNodes.length === this.length ? {
                    fragment: g
                } : ea(a, this, n);
                x = g.fragment;
                if (f = x.childNodes.length === 1 ? x = x.firstChild : x.firstChild) {
                    c = c && b.nodeName(f, "tr");
                    f = 0;
                    for (var s = this.length; f < s; f++) e.call(c ? b.nodeName(this[f], "table") ? this[f].getElementsByTagName("tbody")[0] || this[f].appendChild(this[f].ownerDocument.createElement("tbody")) : this[f] : this[f], f > 0 || g.cacheable || this.length > 1 ? x.cloneNode(true) : x)
                }
                n.length && b.each(n, O)
            }
            return this
        }
    });
    b.fragments = {};
    b.each({
        appendTo: "append",
        prependTo: "prepend",
        insertBefore: "before",
        insertAfter: "after",
        replaceAll: "replaceWith"
    }, function (a, c) {
        b.fn[a] = function (e) {
            var g = [];
            e = b(e);
            var f = this.length === 1 && this[0].parentNode;
            if (f && f.nodeType === 11 && f.childNodes.length === 1 && e.length === 1) {
                e[c](this[0]);
                return this
            } else {
                f = 0;
                for (var l = e.length; f < l; f++) {
                    var n = (f > 0 ? this.clone(true) : this).get();
                    b.fn[c].apply(b(e[f]), n);
                    g = g.concat(n)
                }
                return this.pushStack(g, a, e.selector)
            }
        }
    });
    b.extend({
        clean: function (a, c, e, g) {
            c = c || d;
            if (typeof c.createElement === "undefined") c = c.ownerDocument || c[0] && c[0].ownerDocument || d;
            for (var f = [], l = 0, n;
            (n = a[l]) != null; l++) {
                if (typeof n === "number") n += "";
                if (n) {
                    if (typeof n === "string" && !jb.test(n)) n = c.createTextNode(n);
                    else if (typeof n === "string") {
                        n = n.replace(Ta, Va);
                        var x = (Ua.exec(n) || ["", ""])[1].toLowerCase(),
                            s = ja[x] || ja._default,
                            y = s[0],
                            D = c.createElement("div");
                        for (D.innerHTML = s[1] + n + s[2]; y--;) D = D.lastChild;
                        if (!b.support.tbody) {
                            y = ib.test(n);
                            x = x === "table" && !y ? D.firstChild && D.firstChild.childNodes : s[1] === "<table>" && !y ? D.childNodes : [];
                            for (s = x.length - 1; s >= 0; --s) b.nodeName(x[s], "tbody") && !x[s].childNodes.length && x[s].parentNode.removeChild(x[s])
                        }!b.support.leadingWhitespace && va.test(n) && D.insertBefore(c.createTextNode(va.exec(n)[0]), D.firstChild);
                        n = D.childNodes
                    }
                    if (n.nodeType) f.push(n);
                    else f = b.merge(f, n)
                }
            }
            if (e) for (l = 0; f[l]; l++) if (g && b.nodeName(f[l], "script") && (!f[l].type || f[l].type.toLowerCase() === "text/javascript")) g.push(f[l].parentNode ? f[l].parentNode.removeChild(f[l]) : f[l]);
            else {
                f[l].nodeType === 1 && f.splice.apply(f, [l + 1, 0].concat(b.makeArray(f[l].getElementsByTagName("script"))));
                e.appendChild(f[l])
            }
            return f
        },
        cleanData: function (a) {
            for (var c, e, g = b.cache, f = b.event.special, l = b.support.deleteExpando, n = 0, x;
            (x = a[n]) != null; n++) if (e = x[b.expando]) {
                c = g[e];
                if (c.events) for (var s in c.events) f[s] ? b.event.remove(x, s) : La(x, s, c.handle);
                if (l) delete x[b.expando];
                else x.removeAttribute && x.removeAttribute(b.expando);
                delete g[e]
            }
        }
    });
    var kb = /z-?index|font-?weight|opacity|zoom|line-?height/i,
        Wa = /alpha\([^)]*\)/,
        Xa = /opacity=([^)]*)/,
        Ca = /float/i,
        Da = /-([a-z])/ig,
        lb = /([A-Z])/g,
        mb = /^-?\d+(?:px)?$/i,
        nb = /^-?\d/,
        ob = {
            position: "absolute",
            visibility: "hidden",
            display: "block"
        },
        pb = ["Left", "Right"],
        qb = ["Top", "Bottom"],
        rb = d.defaultView && d.defaultView.getComputedStyle,
        Ya = b.support.cssFloat ? "cssFloat" : "styleFloat",
        Ea = function (a, c) {
            return c.toUpperCase()
        };
    b.fn.css = function (a, c) {
        return L(this, a, c, true, function (e, g, f) {
            if (f === r) return b.curCSS(e, g);
            if (typeof f === "number" && !kb.test(g)) f += "px";
            b.style(e, g, f)
        })
    };
    b.extend({
        style: function (a, c, e) {
            if (!a || a.nodeType === 3 || a.nodeType === 8) return r;
            if ((c === "width" || c === "height") && parseFloat(e) < 0) e = r;
            var g = a.style || a,
                f = e !== r;
            if (!b.support.opacity && c === "opacity") {
                if (f) {
                    g.zoom = 1;
                    c = parseInt(e, 10) + "" === "NaN" ? "" : "alpha(opacity=" + e * 100 + ")";
                    a = g.filter || b.curCSS(a, "filter") || "";
                    g.filter = Wa.test(a) ? a.replace(Wa, c) : c
                }
                return g.filter && g.filter.indexOf("opacity=") >= 0 ? parseFloat(Xa.exec(g.filter)[1]) / 100 + "" : ""
            }
            if (Ca.test(c)) c = Ya;
            c = c.replace(Da, Ea);
            if (f) g[c] = e;
            return g[c]
        },
        css: function (a, c, e, g) {
            if (c === "width" || c === "height") {
                var f, l = c === "width" ? pb : qb;
                e = function () {
                    f = c === "width" ? a.offsetWidth : a.offsetHeight;
                    g !== "border" && b.each(l, function () {
                        g || (f -= parseFloat(b.curCSS(a, "padding" + this, true)) || 0);
                        if (g === "margin") f += parseFloat(b.curCSS(a, "margin" + this, true)) || 0;
                        else f -= parseFloat(b.curCSS(a, "border" + this + "Width", true)) || 0
                    })
                };
                a.offsetWidth !== 0 ? e() : b.swap(a, ob, e);
                return Math.max(0, Math.round(f))
            }
            return b.curCSS(a, c, e)
        },
        curCSS: function (a, c, e) {
            var g, f = a.style;
            if (!b.support.opacity && c === "opacity" && a.currentStyle) {
                g = Xa.test(a.currentStyle.filter || "") ? parseFloat(RegExp.$1) / 100 + "" : "";
                return g === "" ? "1" : g
            }
            if (Ca.test(c)) c = Ya;
            if (!e && f && f[c]) g = f[c];
            else if (rb) {
                if (Ca.test(c)) c = "float";
                c = c.replace(lb, "-$1").toLowerCase();
                f = a.ownerDocument.defaultView;
                if (!f) return null;
                if (a = f.getComputedStyle(a, null)) g = a.getPropertyValue(c);
                if (c === "opacity" && g === "") g = "1"
            } else if (a.currentStyle) {
                e = c.replace(Da, Ea);
                g = a.currentStyle[c] || a.currentStyle[e];
                if (!mb.test(g) && nb.test(g)) {
                    c = f.left;
                    var l = a.runtimeStyle.left;
                    a.runtimeStyle.left = a.currentStyle.left;
                    f.left = e === "fontSize" ? "1em" : g || 0;
                    g = f.pixelLeft + "px";
                    f.left = c;
                    a.runtimeStyle.left = l
                }
            }
            return g
        },
        swap: function (a, c, e) {
            var g = {},
                f;
            for (f in c) {
                g[f] = a.style[f];
                a.style[f] = c[f]
            }
            e.call(a);
            for (f in c) a.style[f] = g[f]
        }
    });
    if (b.expr && b.expr.filters) {
        b.expr.filters.hidden = function (a) {
            var c = a.offsetWidth,
                e = a.offsetHeight,
                g = a.nodeName.toLowerCase() === "tr";
            return c === 0 && e === 0 && !g ? true : c > 0 && e > 0 && !g ? false : b.curCSS(a, "display") === "none"
        };
        b.expr.filters.visible = function (a) {
            return !b.expr.filters.hidden(a)
        }
    }
    var sb = I(),
        tb = /<script(.|\s)*?\/script>/gi,
        ub = /select|textarea/i,
        vb = /color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,
        ra = /=\?(&|$)/,
        Fa = /\?/,
        wb = /(\?|&)_=.*?(&|$)/,
        xb = /^(\w+:)?\/\/([^\/?#]+)/,
        yb = /%20/g,
        zb = b.fn.load;
    b.fn.extend({
        load: function (a, c, e) {
            if (typeof a !== "string") return zb.call(this, a);
            else if (!this.length) return this;
            var g = a.indexOf(" ");
            if (g >= 0) {
                var f = a.slice(g, a.length);
                a = a.slice(0, g)
            }
            g = "GET";
            if (c) if (b.isFunction(c)) {
                e = c;
                c = null
            } else if (typeof c === "object") {
                c = b.param(c, b.ajaxSettings.traditional);
                g = "POST"
            }
            var l = this;
            b.ajax({
                url: a,
                type: g,
                dataType: "html",
                data: c,
                complete: function (n, x) {
                    if (x === "success" || x === "notmodified") l.html(f ? b("<div />").append(n.responseText.replace(tb, "")).find(f) : n.responseText);
                    e && l.each(e, [n.responseText, x, n])
                }
            });
            return this
        },
        serialize: function () {
            return b.param(this.serializeArray())
        },
        serializeArray: function () {
            return this.map(function () {
                return this.elements ? b.makeArray(this.elements) : this
            }).filter(function () {
                return this.name && !this.disabled && (this.checked || ub.test(this.nodeName) || vb.test(this.type))
            }).map(function (a, c) {
                a = b(this).val();
                return a == null ? null : b.isArray(a) ? b.map(a, function (e) {
                    return {
                        name: c.name,
                        value: e
                    }
                }) : {
                    name: c.name,
                    value: a
                }
            }).get()
        }
    });
    b.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "), function (a, c) {
        b.fn[c] = function (e) {
            return this.bind(c, e)
        }
    });
    b.extend({
        get: function (a, c, e, g) {
            if (b.isFunction(c)) {
                g = g || e;
                e = c;
                c = null
            }
            return b.ajax({
                type: "GET",
                url: a,
                data: c,
                success: e,
                dataType: g
            })
        },
        getScript: function (a, c) {
            return b.get(a, null, c, "script")
        },
        getJSON: function (a, c, e) {
            return b.get(a, c, e, "json")
        },
        post: function (a, c, e, g) {
            if (b.isFunction(c)) {
                g = g || e;
                e = c;
                c = {}
            }
            return b.ajax({
                type: "POST",
                url: a,
                data: c,
                success: e,
                dataType: g
            })
        },
        ajaxSetup: function (a) {
            b.extend(b.ajaxSettings, a)
        },
        ajaxSettings: {
            url: location.href,
            global: true,
            type: "GET",
            contentType: "application/x-www-form-urlencoded",
            processData: true,
            async: true,
            xhr: j.XMLHttpRequest && (j.location.protocol !== "file:" || !j.ActiveXObject) ?
            function () {
                return new j.XMLHttpRequest
            } : function () {
                try {
                    return new j.ActiveXObject("Microsoft.XMLHTTP")
                } catch (a) {}
            },
            accepts: {
                xml: "application/xml, text/xml",
                html: "text/html",
                script: "text/javascript, application/javascript",
                json: "application/json, text/javascript",
                text: "text/plain",
                _default: "*/*"
            }
        },
        lastModified: {},
        etag: {},
        ajax: function (a) {
            function c() {
                f.success && f.success.call(s, x, n, U);
                f.global && g("ajaxSuccess", [U, f])
            }
            function e() {
                f.complete && f.complete.call(s, U, n);
                f.global && g("ajaxComplete", [U, f]);
                f.global && !--b.active && b.event.trigger("ajaxStop")
            }
            function g(B, A) {
                (f.context ? b(f.context) : b.event).trigger(B, A)
            }
            var f = b.extend(true, {}, b.ajaxSettings, a),
                l, n, x, s = a && a.context || f,
                y = f.type.toUpperCase();
            if (f.data && f.processData && typeof f.data !== "string") f.data = b.param(f.data, f.traditional);
            if (f.dataType === "jsonp") {
                if (y === "GET") ra.test(f.url) || (f.url += (Fa.test(f.url) ? "&" : "?") + (f.jsonp || "callback") + "=?");
                else if (!f.data || !ra.test(f.data)) f.data = (f.data ? f.data + "&" : "") + (f.jsonp || "callback") + "=?";
                f.dataType = "json"
            }
            if (f.dataType === "json" && (f.data && ra.test(f.data) || ra.test(f.url))) {
                l = f.jsonpCallback || "jsonp" + sb++;
                if (f.data) f.data = (f.data + "").replace(ra, "=" + l + "$1");
                f.url = f.url.replace(ra, "=" + l + "$1");
                f.dataType = "script";
                j[l] = j[l] ||
                function (B) {
                    x = B;
                    c();
                    e();
                    j[l] = r;
                    try {
                        delete j[l]
                    } catch (A) {}
                    Y && Y.removeChild(ba)
                }
            }
            if (f.dataType === "script" && f.cache === null) f.cache = false;
            if (f.cache === false && y === "GET") {
                var D = I(),
                    S = f.url.replace(wb, "$1_=" + D + "$2");
                f.url = S + (S === f.url ? (Fa.test(f.url) ? "&" : "?") + "_=" + D : "")
            }
            if (f.data && y === "GET") f.url += (Fa.test(f.url) ? "&" : "?") + f.data;
            f.global && !b.active++ && b.event.trigger("ajaxStart");
            D = (D = xb.exec(f.url)) && (D[1] && D[1] !== location.protocol || D[2] !== location.host);
            if (f.dataType === "script" && y === "GET" && D) {
                var Y = d.getElementsByTagName("head")[0] || d.documentElement,
                    ba = d.createElement("script");
                ba.src = f.url;
                if (f.scriptCharset) ba.charset = f.scriptCharset;
                if (!l) {
                    var aa = false;
                    ba.onload = ba.onreadystatechange = function () {
                        if (!aa && (!this.readyState || this.readyState === "loaded" || this.readyState === "complete")) {
                            aa = true;
                            c();
                            e();
                            ba.onload = ba.onreadystatechange = null;
                            Y && ba.parentNode && Y.removeChild(ba)
                        }
                    }
                }
                Y.insertBefore(ba, Y.firstChild);
                return r
            }
            var ia = false,
                U = f.xhr();
            if (U) {
                f.username ? U.open(y, f.url, f.async, f.username, f.password) : U.open(y, f.url, f.async);
                try {
                    if (f.data || a && a.contentType) U.setRequestHeader("Content-Type", f.contentType);
                    if (f.ifModified) {
                        b.lastModified[f.url] && U.setRequestHeader("If-Modified-Since", b.lastModified[f.url]);
                        b.etag[f.url] && U.setRequestHeader("If-None-Match", b.etag[f.url])
                    }
                    D || U.setRequestHeader("X-Requested-With", "XMLHttpRequest");
                    U.setRequestHeader("Accept", f.dataType && f.accepts[f.dataType] ? f.accepts[f.dataType] + ", */*" : f.accepts._default)
                } catch (Ba) {}
                if (f.beforeSend && f.beforeSend.call(s, U, f) === false) {
                    f.global && !--b.active && b.event.trigger("ajaxStop");
                    U.abort();
                    return false
                }
                f.global && g("ajaxSend", [U, f]);
                var h = U.onreadystatechange = function (B) {
                        if (!U || U.readyState === 0 || B === "abort") {
                            ia || e();
                            ia = true;
                            if (U) U.onreadystatechange = b.noop
                        } else if (!ia && U && (U.readyState === 4 || B === "timeout")) {
                            ia = true;
                            U.onreadystatechange = b.noop;
                            n = B === "timeout" ? "timeout" : !b.httpSuccess(U) ? "error" : f.ifModified && b.httpNotModified(U, f.url) ? "notmodified" : "success";
                            var A;
                            if (n === "success") try {
                                x = b.httpData(U, f.dataType, f)
                            } catch (Q) {
                                n = "parsererror";
                                A = Q
                            }
                            if (n === "success" || n === "notmodified") l || c();
                            else b.handleError(f, U, n, A);
                            e();
                            B === "timeout" && U.abort();
                            if (f.async) U = null
                        }
                    };
                try {
                    var k = U.abort;
                    U.abort = function () {
                        U && k.call(U);
                        h("abort")
                    }
                } catch (q) {}
                f.async && f.timeout > 0 && setTimeout(function () {
                    U && !ia && h("timeout")
                }, f.timeout);
                try {
                    U.send(y === "POST" || y === "PUT" || y === "DELETE" ? f.data : null)
                } catch (w) {
                    b.handleError(f, U, null, w);
                    e()
                }
                f.async || h();
                return U
            }
        },
        handleError: function (a, c, e, g) {
            if (a.error) a.error.call(a.context || a, c, e, g);
            if (a.global)(a.context ? b(a.context) : b.event).trigger("ajaxError", [c, a, g])
        },
        active: 0,
        httpSuccess: function (a) {
            try {
                return !a.status && location.protocol === "file:" || a.status >= 200 && a.status < 300 || a.status === 304 || a.status === 1223 || a.status === 0
            } catch (c) {}
            return false
        },
        httpNotModified: function (a, c) {
            var e = a.getResponseHeader("Last-Modified"),
                g = a.getResponseHeader("Etag");
            if (e) b.lastModified[c] = e;
            if (g) b.etag[c] = g;
            return a.status === 304 || a.status === 0
        },
        httpData: function (a, c, e) {
            var g = a.getResponseHeader("content-type") || "",
                f = c === "xml" || !c && g.indexOf("xml") >= 0;
            a = f ? a.responseXML : a.responseText;
            f && a.documentElement.nodeName === "parsererror" && b.error("parsererror");
            if (e && e.dataFilter) a = e.dataFilter(a, c);
            if (typeof a === "string") if (c === "json" || !c && g.indexOf("json") >= 0) a = b.parseJSON(a);
            else if (c === "script" || !c && g.indexOf("javascript") >= 0) b.globalEval(a);
            return a
        },
        param: function (a, c) {
            function e(n, x) {
                if (b.isArray(x)) b.each(x, function (s, y) {
                    c || /\[\]$/.test(n) ? g(n, y) : e(n + "[" + (typeof y === "object" || b.isArray(y) ? s : "") + "]", y)
                });
                else!c && x != null && typeof x === "object" ? b.each(x, function (s, y) {
                    e(n + "[" + s + "]", y)
                }) : g(n, x)
            }
            function g(n, x) {
                x = b.isFunction(x) ? x() : x;
                f[f.length] = encodeURIComponent(n) + "=" + encodeURIComponent(x)
            }
            var f = [];
            if (c === r) c = b.ajaxSettings.traditional;
            if (b.isArray(a) || a.jquery) b.each(a, function () {
                g(this.name, this.value)
            });
            else for (var l in a) e(l, a[l]);
            return f.join("&").replace(yb, "+")
        }
    });
    var Ga = {},
        Ab = /toggle|show|hide/,
        Bb = /^([+-]=)?([\d+-.]+)(.*)$/,
        wa, Ja = [
            ["height", "marginTop", "marginBottom", "paddingTop", "paddingBottom"],
            ["width", "marginLeft", "marginRight", "paddingLeft", "paddingRight"],
            ["opacity"]
        ];
    b.fn.extend({
        show: function (a, c) {
            if (a || a === 0) return this.animate(ca("show", 3), a, c);
            else {
                a = 0;
                for (c = this.length; a < c; a++) {
                    var e = b.data(this[a], "olddisplay");
                    this[a].style.display = e || "";
                    if (b.css(this[a], "display") === "none") {
                        e = this[a].nodeName;
                        var g;
                        if (Ga[e]) g = Ga[e];
                        else {
                            var f = b("<" + e + " />").appendTo("body");
                            g = f.css("display");
                            if (g === "none") g = "block";
                            f.remove();
                            Ga[e] = g
                        }
                        b.data(this[a], "olddisplay", g)
                    }
                }
                a = 0;
                for (c = this.length; a < c; a++) this[a].style.display = b.data(this[a], "olddisplay") || "";
                return this
            }
        },
        hide: function (a, c) {
            if (a || a === 0) return this.animate(ca("hide", 3), a, c);
            else {
                a = 0;
                for (c = this.length; a < c; a++) {
                    var e = b.data(this[a], "olddisplay");
                    !e && e !== "none" && b.data(this[a], "olddisplay", b.css(this[a], "display"))
                }
                a = 0;
                for (c = this.length; a < c; a++) this[a].style.display = "none";
                return this
            }
        },
        _toggle: b.fn.toggle,
        toggle: function (a, c) {
            var e = typeof a === "boolean";
            if (b.isFunction(a) && b.isFunction(c)) this._toggle.apply(this, arguments);
            else a == null || e ? this.each(function () {
                var g = e ? a : b(this).is(":hidden");
                b(this)[g ? "show" : "hide"]()
            }) : this.animate(ca("toggle", 3), a, c);
            return this
        },
        fadeTo: function (a, c, e) {
            return this.filter(":hidden").css("opacity", 0).show().end().animate({
                opacity: c
            }, a, e)
        },
        animate: function (a, c, e, g) {
            var f = b.speed(c, e, g);
            if (b.isEmptyObject(a)) return this.each(f.complete);
            return this[f.queue === false ? "each" : "queue"](function () {
                var l = b.extend({}, f),
                    n, x = this.nodeType === 1 && b(this).is(":hidden"),
                    s = this;
                for (n in a) {
                    var y = n.replace(Da, Ea);
                    if (n !== y) {
                        a[y] = a[n];
                        delete a[n];
                        n = y
                    }
                    if (a[n] === "hide" && x || a[n] === "show" && !x) return l.complete.call(this);
                    if ((n === "height" || n === "width") && this.style) {
                        l.display = b.css(this, "display");
                        l.overflow = this.style.overflow
                    }
                    if (b.isArray(a[n])) {
                        (l.specialEasing = l.specialEasing || {})[n] = a[n][1];
                        a[n] = a[n][0]
                    }
                }
                if (l.overflow != null) this.style.overflow = "hidden";
                l.curAnim = b.extend({}, a);
                b.each(a, function (D, S) {
                    var Y = new b.fx(s, l, D);
                    if (Ab.test(S)) Y[S === "toggle" ? x ? "show" : "hide" : S](a);
                    else {
                        var ba = Bb.exec(S),
                            aa = Y.cur(true) || 0;
                        if (ba) {
                            S = parseFloat(ba[2]);
                            var ia = ba[3] || "px";
                            if (ia !== "px") {
                                s.style[D] = (S || 1) + ia;
                                aa *= (S || 1) / Y.cur(true);
                                s.style[D] = aa + ia
                            }
                            if (ba[1]) S = (ba[1] === "-=" ? -1 : 1) * S + aa;
                            Y.custom(aa, S, ia)
                        } else Y.custom(aa, S, "")
                    }
                });
                return true
            })
        },
        stop: function (a, c) {
            var e = b.timers;
            a && this.queue([]);
            this.each(function () {
                for (var g = e.length - 1; g >= 0; g--) if (e[g].elem === this) {
                    c && e[g](true);
                    e.splice(g, 1)
                }
            });
            c || this.dequeue();
            return this
        }
    });
    b.each({
        slideDown: ca("show", 1),
        slideUp: ca("hide", 1),
        slideToggle: ca("toggle", 1),
        fadeIn: {
            opacity: "show"
        },
        fadeOut: {
            opacity: "hide"
        }
    }, function (a, c) {
        b.fn[a] = function (e, g) {
            return this.animate(c, e, g)
        }
    });
    b.extend({
        speed: function (a, c, e) {
            var g = a && typeof a === "object" ? a : {
                complete: e || !e && c || b.isFunction(a) && a,
                duration: a,
                easing: e && c || c && !b.isFunction(c) && c
            };
            g.duration = b.fx.off ? 0 : typeof g.duration === "number" ? g.duration : b.fx.speeds[g.duration] || b.fx.speeds._default;
            g.old = g.complete;
            g.complete = function () {
                g.queue !== false && b(this).dequeue();
                b.isFunction(g.old) && g.old.call(this)
            };
            return g
        },
        easing: {
            linear: function (a, c, e, g) {
                return e + g * a
            },
            swing: function (a, c, e, g) {
                return (-Math.cos(a * Math.PI) / 2 + 0.5) * g + e
            }
        },
        timers: [],
        fx: function (a, c, e) {
            this.options = c;
            this.elem = a;
            this.prop = e;
            if (!c.orig) c.orig = {}
        }
    });
    b.fx.prototype = {
        update: function () {
            this.options.step && this.options.step.call(this.elem, this.now, this);
            (b.fx.step[this.prop] || b.fx.step._default)(this);
            if ((this.prop === "height" || this.prop === "width") && this.elem.style) this.elem.style.display = "block"
        },
        cur: function (a) {
            if (this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null)) return this.elem[this.prop];
            return (a = parseFloat(b.css(this.elem, this.prop, a))) && a > -1E4 ? a : parseFloat(b.curCSS(this.elem, this.prop)) || 0
        },
        custom: function (a, c, e) {
            function g(l) {
                return f.step(l)
            }
            this.startTime = I();
            this.start = a;
            this.end = c;
            this.unit = e || this.unit || "px";
            this.now = this.start;
            this.pos = this.state = 0;
            var f = this;
            g.elem = this.elem;
            if (g() && b.timers.push(g) && !wa) wa = setInterval(b.fx.tick, 13)
        },
        show: function () {
            this.options.orig[this.prop] = b.style(this.elem, this.prop);
            this.options.show = true;
            this.custom(this.prop === "width" || this.prop === "height" ? 1 : 0, this.cur());
            b(this.elem).show()
        },
        hide: function () {
            this.options.orig[this.prop] = b.style(this.elem, this.prop);
            this.options.hide = true;
            this.custom(this.cur(), 0)
        },
        step: function (a) {
            var c = I(),
                e = true;
            if (a || c >= this.options.duration + this.startTime) {
                this.now = this.end;
                this.pos = this.state = 1;
                this.update();
                this.options.curAnim[this.prop] = true;
                for (var g in this.options.curAnim) if (this.options.curAnim[g] !== true) e = false;
                if (e) {
                    if (this.options.display != null) {
                        this.elem.style.overflow = this.options.overflow;
                        a = b.data(this.elem, "olddisplay");
                        this.elem.style.display = a ? a : this.options.display;
                        if (b.css(this.elem, "display") === "none") this.elem.style.display = "block"
                    }
                    this.options.hide && b(this.elem).hide();
                    if (this.options.hide || this.options.show) for (var f in this.options.curAnim) b.style(this.elem, f, this.options.orig[f]);
                    this.options.complete.call(this.elem)
                }
                return false
            } else {
                f = c - this.startTime;
                this.state = f / this.options.duration;
                a = this.options.easing || (b.easing.swing ? "swing" : "linear");
                this.pos = b.easing[this.options.specialEasing && this.options.specialEasing[this.prop] || a](this.state, f, 0, 1, this.options.duration);
                this.now = this.start + (this.end - this.start) * this.pos;
                this.update()
            }
            return true
        }
    };
    b.extend(b.fx, {
        tick: function () {
            for (var a = b.timers, c = 0; c < a.length; c++) a[c]() || a.splice(c--, 1);
            a.length || b.fx.stop()
        },
        stop: function () {
            clearInterval(wa);
            wa = null
        },
        speeds: {
            slow: 600,
            fast: 200,
            _default: 400
        },
        step: {
            opacity: function (a) {
                b.style(a.elem, "opacity", a.now)
            },
            _default: function (a) {
                if (a.elem.style && a.elem.style[a.prop] != null) a.elem.style[a.prop] = (a.prop === "width" || a.prop === "height" ? Math.max(0, a.now) : a.now) + a.unit;
                else a.elem[a.prop] = a.now
            }
        }
    });
    if (b.expr && b.expr.filters) b.expr.filters.animated = function (a) {
        return b.grep(b.timers, function (c) {
            return a === c.elem
        }).length
    };
    b.fn.offset = "getBoundingClientRect" in d.documentElement ?
    function (a) {
        var c = this[0];
        if (a) return this.each(function (f) {
            b.offset.setOffset(this, a, f)
        });
        if (!c || !c.ownerDocument) return null;
        if (c === c.ownerDocument.body) return b.offset.bodyOffset(c);
        var e = c.getBoundingClientRect(),
            g = c.ownerDocument;
        c = g.body;
        g = g.documentElement;
        return {
            top: e.top + (self.pageYOffset || b.support.boxModel && g.scrollTop || c.scrollTop) - (g.clientTop || c.clientTop || 0),
            left: e.left + (self.pageXOffset || b.support.boxModel && g.scrollLeft || c.scrollLeft) - (g.clientLeft || c.clientLeft || 0)
        }
    } : function (a) {
        var c = this[0];
        if (a) return this.each(function (D) {
            b.offset.setOffset(this, a, D)
        });
        if (!c || !c.ownerDocument) return null;
        if (c === c.ownerDocument.body) return b.offset.bodyOffset(c);
        b.offset.initialize();
        var e = c.offsetParent,
            g = c,
            f = c.ownerDocument,
            l, n = f.documentElement,
            x = f.body;
        g = (f = f.defaultView) ? f.getComputedStyle(c, null) : c.currentStyle;
        for (var s = c.offsetTop, y = c.offsetLeft;
        (c = c.parentNode) && c !== x && c !== n;) {
            if (b.offset.supportsFixedPosition && g.position === "fixed") break;
            l = f ? f.getComputedStyle(c, null) : c.currentStyle;
            s -= c.scrollTop;
            y -= c.scrollLeft;
            if (c === e) {
                s += c.offsetTop;
                y += c.offsetLeft;
                if (b.offset.doesNotAddBorder && !(b.offset.doesAddBorderForTableAndCells && /^t(able|d|h)$/i.test(c.nodeName))) {
                    s += parseFloat(l.borderTopWidth) || 0;
                    y += parseFloat(l.borderLeftWidth) || 0
                }
                g = e;
                e = c.offsetParent
            }
            if (b.offset.subtractsBorderForOverflowNotVisible && l.overflow !== "visible") {
                s += parseFloat(l.borderTopWidth) || 0;
                y += parseFloat(l.borderLeftWidth) || 0
            }
            g = l
        }
        if (g.position === "relative" || g.position === "static") {
            s += x.offsetTop;
            y += x.offsetLeft
        }
        if (b.offset.supportsFixedPosition && g.position === "fixed") {
            s += Math.max(n.scrollTop, x.scrollTop);
            y += Math.max(n.scrollLeft, x.scrollLeft)
        }
        return {
            top: s,
            left: y
        }
    };
    b.offset = {
        initialize: function () {
            var a = d.body,
                c = d.createElement("div"),
                e, g, f, l = parseFloat(b.curCSS(a, "marginTop", true)) || 0;
            b.extend(c.style, {
                position: "absolute",
                top: 0,
                left: 0,
                margin: 0,
                border: 0,
                width: "1px",
                height: "1px",
                visibility: "hidden"
            });
            c.innerHTML = "<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";
            a.insertBefore(c, a.firstChild);
            e = c.firstChild;
            g = e.firstChild;
            f = e.nextSibling.firstChild.firstChild;
            this.doesNotAddBorder = g.offsetTop !== 5;
            this.doesAddBorderForTableAndCells = f.offsetTop === 5;
            g.style.position = "fixed";
            g.style.top = "20px";
            this.supportsFixedPosition = g.offsetTop === 20 || g.offsetTop === 15;
            g.style.position = g.style.top = "";
            e.style.overflow = "hidden";
            e.style.position = "relative";
            this.subtractsBorderForOverflowNotVisible = g.offsetTop === -5;
            this.doesNotIncludeMarginInBodyOffset = a.offsetTop !== l;
            a.removeChild(c);
            b.offset.initialize = b.noop
        },
        bodyOffset: function (a) {
            var c = a.offsetTop,
                e = a.offsetLeft;
            b.offset.initialize();
            if (b.offset.doesNotIncludeMarginInBodyOffset) {
                c += parseFloat(b.curCSS(a, "marginTop", true)) || 0;
                e += parseFloat(b.curCSS(a, "marginLeft", true)) || 0
            }
            return {
                top: c,
                left: e
            }
        },
        setOffset: function (a, c, e) {
            if (/static/.test(b.curCSS(a, "position"))) a.style.position = "relative";
            var g = b(a),
                f = g.offset(),
                l = parseInt(b.curCSS(a, "top", true), 10) || 0,
                n = parseInt(b.curCSS(a, "left", true), 10) || 0;
            if (b.isFunction(c)) c = c.call(a, e, f);
            e = {
                top: c.top - f.top + l,
                left: c.left - f.left + n
            };
            "using" in c ? c.using.call(a, e) : g.css(e)
        }
    };
    b.fn.extend({
        position: function () {
            if (!this[0]) return null;
            var a = this[0],
                c = this.offsetParent(),
                e = this.offset(),
                g = /^body|html$/i.test(c[0].nodeName) ? {
                    top: 0,
                    left: 0
                } : c.offset();
            e.top -= parseFloat(b.curCSS(a, "marginTop", true)) || 0;
            e.left -= parseFloat(b.curCSS(a, "marginLeft", true)) || 0;
            g.top += parseFloat(b.curCSS(c[0], "borderTopWidth", true)) || 0;
            g.left += parseFloat(b.curCSS(c[0], "borderLeftWidth", true)) || 0;
            return {
                top: e.top - g.top,
                left: e.left - g.left
            }
        },
        offsetParent: function () {
            return this.map(function () {
                for (var a = this.offsetParent || d.body; a && !/^body|html$/i.test(a.nodeName) && b.css(a, "position") === "static";) a = a.offsetParent;
                return a
            })
        }
    });
    b.each(["Left", "Top"], function (a, c) {
        var e = "scroll" + c;
        b.fn[e] = function (g) {
            var f = this[0],
                l;
            if (!f) return null;
            return g !== r ? this.each(function () {
                if (l = fa(this)) l.scrollTo(!a ? g : b(l).scrollLeft(), a ? g : b(l).scrollTop());
                else this[e] = g
            }) : (l = fa(f)) ? "pageXOffset" in l ? l[a ? "pageYOffset" : "pageXOffset"] : b.support.boxModel && l.document.documentElement[e] || l.document.body[e] : f[e]
        }
    });
    b.each(["Height", "Width"], function (a, c) {
        var e = c.toLowerCase();
        b.fn["inner" + c] = function () {
            return this[0] ? b.css(this[0], e, false, "padding") : null
        };
        b.fn["outer" + c] = function (g) {
            return this[0] ? b.css(this[0], e, false, g ? "margin" : "border") : null
        };
        b.fn[e] = function (g) {
            var f = this[0];
            if (!f) return g == null ? null : this;
            if (b.isFunction(g)) return this.each(function (l) {
                var n = b(this);
                n[e](g.call(this, l, n[e]()))
            });
            return "scrollTo" in f && f.document ? f.document.compatMode === "CSS1Compat" && f.document.documentElement["client" + c] || f.document.body["client" + c] : f.nodeType === 9 ? Math.max(f.documentElement["client" + c], f.body["scroll" + c], f.documentElement["scroll" + c], f.body["offset" + c], f.documentElement["offset" + c]) : g === r ? b.css(f, e) : this.css(e, typeof g === "string" ? g : g + "px")
        }
    });
    j.jQuery = j.$ = b
})(window);
/*
 Galleria v 1.2.3b1 2011-04-05
 http://galleria.aino.se

 Copyright (c) 2011, Aino
 Licensed under the MIT license.
*/
(function (j) {
    var r = this,
        u = r.document,
        O = j(u),
        L = false,
        I = navigator.userAgent.toLowerCase(),
        V = r.location.hash.replace(/#\//, ""),
        W = function () {
            return t.TOUCH ? "touchstart" : "click"
        },
        M = function () {
            var d = 3,
                i = u.createElement("div"),
                m = i.getElementsByTagName("i");
            do i.innerHTML = "<\!--[if gt IE " + ++d + "]><i></i><![endif]--\>";
            while (m[0]);
            return d > 4 ? d : void 0
        }(),
        Z = function () {
            return {
                html: u.documentElement,
                body: u.body,
                head: u.getElementsByTagName("head")[0],
                title: u.title
            }
        },
        ga = function () {
            var d = [];
            j.each("data ready thumbnail loadstart loadfinish image play pause progress fullscreen_enter fullscreen_exit idle_enter idle_exit rescale lightbox_open lightbox_close lightbox_image".split(" "), function (i, m) {
                d.push(m);
                /_/.test(m) && d.push(m.replace(/_/g, ""))
            });
            return d
        }(),
        T = function (d) {
            var i;
            if (typeof d !== "object") return d;
            j.each(d, function (m, o) {
                if (/^[a-z]+_/.test(m)) {
                    i = "";
                    j.each(m.split("_"), function (z, C) {
                        i += z > 0 ? C.substr(0, 1).toUpperCase() + C.substr(1) : C
                    });
                    d[i] = o;
                    delete d[m]
                }
            });
            return d
        },
        ea = function (d) {
            if (j.inArray(d, ga) > -1) return t[d.toUpperCase()];
            return d
        },
        ca = {
            trunk: {},
            add: function (d, i, m, o) {
                o = o || false;
                this.clear(d);
                if (o) {
                    var z = i;
                    i = function () {
                        z();
                        ca.add(d, i, m)
                    }
                }
                this.trunk[d] = r.setTimeout(i, m)
            },
            clear: function (d) {
                var i = function (o) {
                        r.clearTimeout(this.trunk[o]);
                        delete this.trunk[o]
                    },
                    m;
                if (d && d in this.trunk) i.call(ca, d);
                else if (typeof d === "undefined") for (m in this.trunk) this.trunk.hasOwnProperty(m) && i.call(ca, m)
            }
        },
        fa = [],
        b = function () {
            return {
                array: function (d) {
                    return Array.prototype.slice.call(d)
                },
                create: function (d, i) {
                    var m = u.createElement(i || "div");
                    m.className = d;
                    return m
                },
                forceStyles: function (d, i) {
                    d = j(d);
                    d.attr("style") && d.data("styles", d.attr("style")).removeAttr("style");
                    d.css(i)
                },
                revertStyles: function () {
                    j.each(b.array(arguments), function (d, i) {
                        i = j(i).removeAttr("style");
                        i.data("styles") && i.attr("style", i.data("styles")).data("styles", null)
                    })
                },
                moveOut: function (d) {
                    b.forceStyles(d, {
                        position: "absolute",
                        left: -1E4
                    })
                },
                moveIn: function () {
                    b.revertStyles.apply(b, b.array(arguments))
                },
                hide: function (d, i, m) {
                    d = j(d);
                    d.data("opacity") || d.data("opacity", d.css("opacity"));
                    var o = {
                        opacity: 0
                    };
                    i ? d.stop().animate(o, i, m) : d.css(o)
                },
                show: function (d, i, m) {
                    d = j(d);
                    var o = {
                        opacity: parseFloat(d.data("opacity")) || 1
                    };
                    i ? d.stop().animate(o, i, m) : d.css(o)
                },
                addTimer: function () {
                    ca.add.apply(ca, b.array(arguments));
                    return this
                },
                clearTimer: function () {
                    ca.clear.apply(ca, b.array(arguments));
                    return this
                },
                wait: function (d) {
                    d = j.extend({
                        until: function () {
                            return false
                        },
                        success: function () {},
                        error: function () {
                            t.raise("Could not complete wait function.")
                        },
                        timeout: 3E3
                    }, d);
                    var i = b.timestamp(),
                        m, o, z = function () {
                            o = b.timestamp();
                            m = o - i;
                            if (d.until(m)) {
                                d.success();
                                return false
                            }
                            if (o >= i + d.timeout) {
                                d.error();
                                return false
                            }
                            r.setTimeout(z, 2)
                        };
                    r.setTimeout(z, 2)
                },
                toggleQuality: function (d, i) {
                    if (!(M !== 7 && M !== 8 || !d)) {
                        if (typeof i === "undefined") i = d.style.msInterpolationMode === "nearest-neighbor";
                        d.style.msInterpolationMode = i ? "bicubic" : "nearest-neighbor"
                    }
                },
                insertStyleTag: function (d) {
                    var i = u.createElement("style");
                    Z().head.appendChild(i);
                    if (i.styleSheet) i.styleSheet.cssText = d;
                    else {
                        d = u.createTextNode(d);
                        i.appendChild(d)
                    }
                },
                loadScript: function (d, i) {
                    var m = false,
                        o = j("<script>").attr({
                            src: d,
                            async: true
                        }).get(0);
                    o.onload = o.onreadystatechange = function () {
                        if (!m && (!this.readyState || this.readyState === "loaded" || this.readyState === "complete")) {
                            m = true;
                            o.onload = o.onreadystatechange = null;
                            typeof i === "function" && i.call(this, this)
                        }
                    };
                    Z().head.appendChild(o)
                },
                parseValue: function (d) {
                    if (typeof d === "number") return d;
                    else if (typeof d === "string") return (d = d.match(/\-?\d/g)) && d.constructor === Array ? parseInt(d.join(""), 10) : 0;
                    else return 0
                },
                timestamp: function () {
                    return (new Date).getTime()
                },
                loadCSS: function (d, i, m) {
                    var o, z = false,
                        C;
                    j("link[rel=stylesheet]").each(function () {
                        if (RegExp(d).test(this.href)) {
                            o = this;
                            return false
                        }
                    });
                    if (typeof i === "function") {
                        m = i;
                        i = void 0
                    }
                    m = m ||
                    function () {};
                    if (o) {
                        m.call(o, o);
                        return o
                    }
                    C = u.styleSheets.length;
                    if (L) d += "?" + b.timestamp();
                    if (j("#" + i).length) {
                        j("#" + i).attr("href", d);
                        C--;
                        z = true
                    } else {
                        o = j("<link>").attr({
                            rel: "stylesheet",
                            href: d,
                            id: i
                        }).get(0);
                        r.setTimeout(function () {
                            var F = j('link[rel="stylesheet"], style');
                            F.length ? F.get(0).parentNode.insertBefore(o, F[0]) : Z().head.appendChild(o);
                            if (M) o.attachEvent("onreadystatechange", function () {
                                if (o.readyState === "complete") z = true
                            });
                            else z = true
                        }, 10)
                    }
                    typeof m === "function" && b.wait({
                        until: function () {
                            return z && u.styleSheets.length > C
                        },
                        success: function () {
                            b.addTimer("css", function () {
                                m.call(o, o)
                            }, 100)
                        },
                        error: function () {
                            t.raise("Theme CSS could not load")
                        },
                        timeout: 1E4
                    });
                    return o
                }
            }
        }(),
        ka = {
            fade: function (d, i) {
                j(d.next).css("opacity", 0).show().animate({
                    opacity: 1
                }, d.speed, i);
                d.prev && j(d.prev).css("opacity", 1).show().animate({
                    opacity: 0
                }, d.speed)
            },
            flash: function (d, i) {
                j(d.next).css("opacity", 0);
                d.prev ? j(d.prev).animate({
                    opacity: 0
                }, d.speed / 2, function () {
                    j(d.next).animate({
                        opacity: 1
                    }, d.speed, i)
                }) : j(d.next).animate({
                    opacity: 1
                }, d.speed, i)
            },
            pulse: function (d, i) {
                d.prev && j(d.prev).hide();
                j(d.next).css("opacity", 0).animate({
                    opacity: 1
                }, d.speed, i)
            },
            slide: function (d, i) {
                var m = j(d.next).parent(),
                    o = this.$("images"),
                    z = this._stageWidth,
                    C = this.getOptions("easing");
                m.css({
                    left: z * (d.rewind ? -1 : 1)
                });
                o.animate({
                    left: z * (d.rewind ? 1 : -1)
                }, {
                    duration: d.speed,
                    queue: false,
                    easing: C,
                    complete: function () {
                        o.css("left", 0);
                        m.css("left", 0);
                        i()
                    }
                })
            },
            fadeslide: function (d, i) {
                var m = 0,
                    o = this.getOptions("easing"),
                    z = this.getStageWidth();
                if (d.prev) {
                    m = b.parseValue(j(d.prev).css("left"));
                    j(d.prev).css({
                        opacity: 1,
                        left: m
                    }).animate({
                        opacity: 0,
                        left: m + z * (d.rewind ? 1 : -1)
                    }, {
                        duration: d.speed,
                        queue: false,
                        easing: o
                    })
                }
                m = b.parseValue(j(d.next).css("left"));
                j(d.next).css({
                    left: m + z * (d.rewind ? -1 : 1),
                    opacity: 0
                }).animate({
                    opacity: 1,
                    left: m
                }, {
                    duration: d.speed,
                    complete: i,
                    queue: false,
                    easing: o
                })
            }
        },
        t = function () {
            var d = this;
            this._theme = void 0;
            this._options = {};
            this._playing = false;
            this._playtime = 5E3;
            this._active = null;
            this._queue = {
                length: 0
            };
            this._data = [];
            this._dom = {};
            this._thumbnails = [];
            this._initialized = false;
            this._stageHeight = this._stageWidth = 0;
            this._target = void 0;
            this._id = Math.random();
            j.each("container stage images image-nav image-nav-left image-nav-right info info-text info-title info-description thumbnails thumbnails-list thumbnails-container thumb-nav-left thumb-nav-right loader counter tooltip".split(" "), function (p, v) {
                d._dom[v] = b.create("galleria-" + v)
            });
            j.each("current total".split(" "), function (p, v) {
                d._dom[v] = b.create("galleria-" + v, "span")
            });
            var i = this._keyboard = {
                keys: {
                    UP: 38,
                    DOWN: 40,
                    LEFT: 37,
                    RIGHT: 39,
                    RETURN: 13,
                    ESCAPE: 27,
                    BACKSPACE: 8,
                    SPACE: 32
                },
                map: {},
                bound: false,
                press: function (p) {
                    var v = p.keyCode || p.which;
                    v in i.map && typeof i.map[v] === "function" && i.map[v].call(d, p)
                },
                attach: function (p) {
                    var v, H;
                    for (v in p) if (p.hasOwnProperty(v)) {
                        H = v.toUpperCase();
                        if (H in i.keys) i.map[i.keys[H]] = p[v];
                        else i.map[H] = p[v]
                    }
                    if (!i.bound) {
                        i.bound = true;
                        O.bind("keydown", i.press)
                    }
                },
                detach: function () {
                    i.bound = false;
                    i.map = {};
                    O.unbind("keydown", i.press)
                }
            },
                m = this._controls = {
                    0: void 0,
                    1: void 0,
                    active: 0,
                    swap: function () {
                        m.active = m.active ? 0 : 1
                    },
                    getActive: function () {
                        return m[m.active]
                    },
                    getNext: function () {
                        return m[1 - m.active]
                    }
                },
                o = this._carousel = {
                    next: d.$("thumb-nav-right"),
                    prev: d.$("thumb-nav-left"),
                    width: 0,
                    current: 0,
                    max: 0,
                    hooks: [],
                    update: function () {
                        var p = 0,
                            v = 0,
                            H = [0];
                        j.each(d._thumbnails, function (J, K) {
                            if (K.ready) {
                                p += K.outerWidth || j(K.container).outerWidth(true);
                                H[J + 1] = p;
                                v = Math.max(v, K.outerHeight || j(K.container).outerHeight(true))
                            }
                        });
                        d.$("thumbnails").css({
                            width: p,
                            height: v
                        });
                        o.max = p;
                        o.hooks = H;
                        o.width = d.$("thumbnails-list").width();
                        o.setClasses();
                        d.$("thumbnails-container").toggleClass("galleria-carousel", p > o.width);
                        o.width = d.$("thumbnails-list").width()
                    },
                    bindControls: function () {
                        var p;
                        o.next.bind(W(), function (v) {
                            v.preventDefault();
                            if (d._options.carouselSteps === "auto") for (p = o.current; p < o.hooks.length; p++) {
                                if (o.hooks[p] - o.hooks[o.current] > o.width) {
                                    o.set(p - 2);
                                    break
                                }
                            } else o.set(o.current + d._options.carouselSteps)
                        });
                        o.prev.bind(W(), function (v) {
                            v.preventDefault();
                            if (d._options.carouselSteps === "auto") for (p = o.current; p >= 0; p--) if (o.hooks[o.current] - o.hooks[p] > o.width) {
                                o.set(p + 2);
                                break
                            } else {
                                if (p === 0) {
                                    o.set(0);
                                    break
                                }
                            } else o.set(o.current - d._options.carouselSteps)
                        })
                    },
                    set: function (p) {
                        for (p = Math.max(p, 0); o.hooks[p - 1] + o.width >= o.max && p >= 0;) p--;
                        o.current = p;
                        o.animate()
                    },
                    getLast: function (p) {
                        return (p || o.current) - 1
                    },
                    follow: function (p) {
                        if (p === 0 || p === o.hooks.length - 2) o.set(p);
                        else {
                            for (var v = o.current; o.hooks[v] - o.hooks[o.current] < o.width && v <= o.hooks.length;) v++;
                            if (p - 1 < o.current) o.set(p - 1);
                            else p + 2 > v && o.set(p - v + o.current + 2)
                        }
                    },
                    setClasses: function () {
                        o.prev.toggleClass("disabled", !o.current);
                        o.next.toggleClass("disabled", o.hooks[o.current] + o.width >= o.max)
                    },
                    animate: function () {
                        o.setClasses();
                        var p = o.hooks[o.current] * -1;
                        isNaN(p) || d.$("thumbnails").animate({
                            left: p
                        }, {
                            duration: d._options.carouselSpeed,
                            easing: d._options.easing,
                            queue: false
                        })
                    }
                },
                z = this._tooltip = {
                    initialized: false,
                    open: false,
                    init: function () {
                        z.initialized = true;
                        b.insertStyleTag(".galleria-tooltip{padding:3px 8px;max-width:50%;background:#ffe;color:#000;z-index:3;position:absolute;font-size:11px;line-height:1.3opacity:0;box-shadow:0 0 2px rgba(0,0,0,.4);-moz-box-shadow:0 0 2px rgba(0,0,0,.4);-webkit-box-shadow:0 0 2px rgba(0,0,0,.4);}");
                        d.$("tooltip").css("opacity", 0.8);
                        b.hide(d.get("tooltip"))
                    },
                    move: function (p) {
                        var v = d.getMousePosition(p).x;
                        p = d.getMousePosition(p).y;
                        var H = d.$("tooltip"),
                            J = p,
                            K = H.outerHeight(true) + 1,
                            P = H.outerWidth(true),
                            R = K + 15;
                        P = d.$("container").width() - P - 2;
                        K = d.$("container").height() - K - 2;
                        if (!isNaN(v) && !isNaN(J)) {
                            v += 10;
                            J -= 30;
                            v = Math.max(0, Math.min(P, v));
                            J = Math.max(0, Math.min(K, J));
                            if (p < R) J = R;
                            H.css({
                                left: v,
                                top: J
                            })
                        }
                    },
                    bind: function (p, v) {
                        z.initialized || z.init();
                        var H = function (J, K) {
                                z.define(J, K);
                                j(J).hover(function () {
                                    b.clearTimer("switch_tooltip");
                                    d.$("container").unbind("mousemove", z.move).bind("mousemove", z.move).trigger("mousemove");
                                    z.show(J);
                                    t.utils.addTimer("tooltip", function () {
                                        d.$("tooltip").stop().show();
                                        b.show(d.get("tooltip"), 400);
                                        z.open = true
                                    }, z.open ? 0 : 500)
                                }, function () {
                                    d.$("container").unbind("mousemove", z.move);
                                    b.clearTimer("tooltip");
                                    d.$("tooltip").stop();
                                    b.hide(d.get("tooltip"), 200, function () {
                                        d.$("tooltip").hide();
                                        b.addTimer("switch_tooltip", function () {
                                            z.open = false
                                        }, 1E3)
                                    })
                                })
                            };
                        typeof v === "string" ? H(p in d._dom ? d.get(p) : p, v) : j.each(p, function (J, K) {
                            H(d.get(J), K)
                        })
                    },
                    show: function (p) {
                        p = j(p in d._dom ? d.get(p) : p);
                        var v = p.data("tt"),
                            H = function (J) {
                                r.setTimeout(function (K) {
                                    return function () {
                                        z.move(K)
                                    }
                                }(J), 10);
                                p.unbind("mouseup", H)
                            };
                        if (v = typeof v === "function" ? v() : v) {
                            d.$("tooltip").html(v.replace(/\s/, "&nbsp;"));
                            p.bind("mouseup", H)
                        }
                    },
                    define: function (p, v) {
                        if (typeof v !== "function") {
                            var H = v;
                            v = function () {
                                return H
                            }
                        }
                        p = j(p in d._dom ? d.get(p) : p).data("tt", v);
                        z.show(p)
                    }
                },
                C = this._fullscreen = {
                    scrolled: 0,
                    active: false,
                    keymap: d._keyboard.map,
                    enter: function (p) {
                        C.active = true;
                        b.hide(d.getActiveImage());
                        d.$("container").addClass("fullscreen");
                        C.scrolled = j(r).scrollTop();
                        b.forceStyles(d.get("container"), {
                            position: "fixed",
                            top: 0,
                            left: 0,
                            width: "100%",
                            height: "100%",
                            zIndex: 1E4
                        });
                        var v = {
                            height: "100%",
                            overflow: "hidden",
                            margin: 0,
                            padding: 0
                        },
                            H = d.getData();
                        b.forceStyles(Z().html, v);
                        b.forceStyles(Z().body, v);
                        C.keymap = j.extend({}, d._keyboard.map);
                        d.attachKeyboard({
                            escape: d.exitFullscreen,
                            right: d.next,
                            left: d.prev
                        });
                        if (H && H.big && H.image !== H.big) {
                            v = new t.Picture;
                            var J = v.isCached(H.big),
                                K = d.getIndex(),
                                P = d._thumbnails[K];
                            d.trigger({
                                type: t.LOADSTART,
                                cached: J,
                                index: K,
                                imageTarget: d.getActiveImage(),
                                thumbTarget: P
                            });
                            v.load(H.big, function (R) {
                                d._scaleImage(R, {
                                    complete: function (da) {
                                        d.trigger({
                                            type: t.LOADFINISH,
                                            cached: J,
                                            index: K,
                                            imageTarget: da.image,
                                            thumbTarget: P
                                        });
                                        var $ = d._controls.getActive().image;
                                        $ && j($).width(da.image.width).height(da.image.height).attr("style", j(da.image).attr("style")).attr("src", da.image.src)
                                    }
                                })
                            })
                        }
                        d.rescale(function () {
                            b.addTimer("fullscreen_enter", function () {
                                b.show(d.getActiveImage());
                                typeof p === "function" && p.call(d)
                            }, 100);
                            d.trigger(t.FULLSCREEN_ENTER)
                        });
                        j(r).resize(function () {
                            C.scale()
                        })
                    },
                    scale: function () {
                        d.rescale()
                    },
                    exit: function (p) {
                        C.active = false;
                        b.hide(d.getActiveImage());
                        d.$("container").removeClass("fullscreen");
                        b.revertStyles(d.get("container"), Z().html, Z().body);
                        r.scrollTo(0, C.scrolled);
                        d.detachKeyboard();
                        d.attachKeyboard(C.keymap);
                        d.rescale(function () {
                            b.addTimer("fullscreen_exit", function () {
                                b.show(d.getActiveImage());
                                typeof p === "function" && p.call(d)
                            }, 50);
                            d.trigger(t.FULLSCREEN_EXIT)
                        });
                        j(r).unbind("resize", C.scale)
                    }
                },
                F = this._idle = {
                    trunk: [],
                    bound: false,
                    add: function (p, v) {
                        if (p) {
                            F.bound || F.addEvent();
                            p = j(p);
                            var H = {},
                                J;
                            for (J in v) if (v.hasOwnProperty(J)) H[J] = p.css(J);
                            p.data("idle", {
                                from: H,
                                to: v,
                                complete: true,
                                busy: false
                            });
                            F.addTimer();
                            F.trunk.push(p)
                        }
                    },
                    remove: function (p) {
                        p = jQuery(p);
                        j.each(F.trunk, function (v, H) {
                            if (H.length && !H.not(p).length) {
                                d._idle.show(p);
                                d._idle.trunk.splice(v, 1)
                            }
                        });
                        if (!F.trunk.length) {
                            F.removeEvent();
                            b.clearTimer("idle")
                        }
                    },
                    addEvent: function () {
                        F.bound = true;
                        d.$("container").bind("mousemove click", F.showAll)
                    },
                    removeEvent: function () {
                        F.bound = false;
                        d.$("container").unbind("mousemove click", F.showAll)
                    },
                    addTimer: function () {
                        b.addTimer("idle", function () {
                            d._idle.hide()
                        }, d._options.idleTime)
                    },
                    hide: function () {
                        d.trigger(t.IDLE_ENTER);
                        j.each(F.trunk, function (p, v) {
                            var H = v.data("idle");
                            if (H) {
                                v.data("idle").complete = false;
                                v.stop().animate(H.to, {
                                    duration: d._options.idleSpeed,
                                    queue: false,
                                    easing: "swing"
                                })
                            }
                        })
                    },
                    showAll: function () {
                        b.clearTimer("idle");
                        j.each(d._idle.trunk, function (p, v) {
                            d._idle.show(v)
                        })
                    },
                    show: function (p) {
                        var v = p.data("idle");
                        if (!v.busy && !v.complete) {
                            v.busy = true;
                            d.trigger(t.IDLE_EXIT);
                            b.clearTimer("idle");
                            p.stop().animate(v.from, {
                                duration: d._options.idleSpeed / 2,
                                queue: false,
                                easing: "swing",
                                complete: function () {
                                    j(this).data("idle").busy = false;
                                    j(this).data("idle").complete = true
                                }
                            })
                        }
                        F.addTimer()
                    }
                },
                E = this._lightbox = {
                    width: 0,
                    height: 0,
                    initialized: false,
                    active: null,
                    image: null,
                    elems: {},
                    init: function () {
                        d.trigger(t.LIGHTBOX_OPEN);
                        if (!E.initialized) {
                            E.initialized = true;
                            var p = {},
                                v = d._options,
                                H = "";
                            v = {
                                overlay: "position:fixed;display:none;opacity:" + v.overlayOpacity + ";filter:alpha(opacity=" + v.overlayOpacity * 100 + ");top:0;left:0;width:100%;height:100%;background:" + v.overlayBackground + ";z-index:99990",
                                box: "position:fixed;display:none;width:400px;height:400px;top:50%;left:50%;margin-top:-200px;margin-left:-200px;z-index:99991",
                                shadow: "position:absolute;background:#000;width:100%;height:100%;",
                                content: "position:absolute;background-color:#fff;top:10px;left:10px;right:10px;bottom:10px;overflow:hidden",
                                info: "position:absolute;bottom:10px;left:10px;right:10px;color:#444;font:11px/13px arial,sans-serif;height:13px",
                                close: "position:absolute;top:10px;right:10px;height:20px;width:20px;background:#fff;text-align:center;cursor:pointer;color:#444;font:16px/22px arial,sans-serif;z-index:99999",
                                image: "position:absolute;top:10px;left:10px;right:10px;bottom:30px;overflow:hidden;display:block;",
                                prevholder: "position:absolute;width:50%;top:0;bottom:40px;cursor:pointer;",
                                nextholder: "position:absolute;width:50%;top:0;bottom:40px;right:-1px;cursor:pointer;",
                                prev: "position:absolute;top:50%;margin-top:-20px;height:40px;width:30px;background:#fff;left:20px;display:none;text-align:center;color:#000;font:bold 16px/36px arial,sans-serif",
                                next: "position:absolute;top:50%;margin-top:-20px;height:40px;width:30px;background:#fff;right:20px;left:auto;display:none;font:bold 16px/36px arial,sans-serif;text-align:center;color:#000",
                                title: "float:left",
                                counter: "float:right;margin-left:8px;"
                            };
                            var J = {};
                            if (M === 8) {
                                v.nextholder += "background:#000;filter:alpha(opacity=0);";
                                v.prevholder += "background:#000;filter:alpha(opacity=0);"
                            }
                            j.each(v, function (K, P) {
                                H += ".galleria-lightbox-" + K + "{" + P + "}"
                            });
                            b.insertStyleTag(H);
                            j.each("overlay box content shadow title info close prevholder prev nextholder next counter image".split(" "), function (K, P) {
                                d.addElement("lightbox-" + P);
                                p[P] = E.elems[P] = d.get("lightbox-" + P)
                            });
                            E.image = new t.Picture;
                            j.each({
                                box: "shadow content close prevholder nextholder",
                                info: "title counter",
                                content: "info image",
                                prevholder: "prev",
                                nextholder: "next"
                            }, function (K, P) {
                                var R = [];
                                j.each(P.split(" "), function (da, $) {
                                    R.push("lightbox-" + $)
                                });
                                J["lightbox-" + K] = R
                            });
                            d.append(J);
                            j(p.image).append(E.image.container);
                            j(Z().body).append(p.overlay, p.box);
                            (function (K) {
                                return K.hover(function () {
                                    j(this).css("color", "#bbb")
                                }, function () {
                                    j(this).css("color", "#444")
                                })
                            })(j(p.close).bind(W(), E.hide).html("&#215;"));
                            j.each(["Prev", "Next"], function (K, P) {
                                var R = j(p[P.toLowerCase()]).html(/v/.test(P) ? "&#8249;&nbsp;" : "&nbsp;&#8250;"),
                                    da = j(p[P.toLowerCase() + "holder"]);
                                da.bind(W(), function () {
                                    E["show" + P]()
                                });
                                M < 8 ? R.show() : da.hover(function () {
                                    R.show()
                                }, function () {
                                    R.stop().fadeOut(200)
                                })
                            });
                            j(p.overlay).bind(W(), E.hide)
                        }
                    },
                    rescale: function (p) {
                        var v = Math.min(j(r).width() - 40, E.width),
                            H = Math.min(j(r).height() - 60, E.height);
                        H = Math.min(v / E.width, H / E.height);
                        v = E.width * H + 40;
                        H = E.height * H + 60;
                        v = {
                            width: v,
                            height: H,
                            marginTop: Math.ceil(H / 2) * -1,
                            marginLeft: Math.ceil(v / 2) * -1
                        };
                        p ? j(E.elems.box).css(v) : j(E.elems.box).animate(v, d._options.lightboxTransitionSpeed, d._options.easing, function () {
                            var J = E.image,
                                K = d._options.lightboxFadeSpeed;
                            d.trigger({
                                type: t.LIGHTBOX_IMAGE,
                                imageTarget: J.image
                            });
                            j(J.container).show();
                            b.show(J.image, K);
                            b.show(E.elems.info, K)
                        })
                    },
                    hide: function () {
                        E.image.image = null;
                        j(r).unbind("resize", E.rescale);
                        j(E.elems.box).hide();
                        b.hide(E.elems.info);
                        b.hide(E.elems.overlay, 200, function () {
                            j(this).hide().css("opacity", d._options.overlayOpacity);
                            d.trigger(t.LIGHTBOX_CLOSE)
                        })
                    },
                    showNext: function () {
                        E.show(d.getNext(E.active))
                    },
                    showPrev: function () {
                        E.show(d.getPrev(E.active))
                    },
                    show: function (p) {
                        E.active = p = typeof p === "number" ? p : d.getIndex();
                        E.initialized || E.init();
                        j(r).unbind("resize", E.rescale);
                        var v = d.getData(p),
                            H = d.getDataLength();
                        b.hide(E.elems.info);
                        E.image.load(v.image, function (J) {
                            E.width = J.original.width;
                            E.height = J.original.height;
                            j(J.image).css({
                                width: "100.5%",
                                height: "100.5%",
                                top: 0,
                                zIndex: 99998
                            });
                            b.hide(J.image);
                            E.elems.title.innerHTML = v.title;
                            E.elems.counter.innerHTML = p + 1 + " / " + H;
                            j(r).resize(E.rescale);
                            E.rescale()
                        });
                        j(E.elems.overlay).show();
                        j(E.elems.box).show()
                    }
                };
            return this
        };
    t.prototype = {
        constructor: t,
        init: function (d, i) {
            var m = this;
            i = T(i);
            fa.push(this);
            this._original = {
                target: d,
                options: i,
                data: null
            };
            if (this._target = this._dom.target = d.nodeName ? d : j(d).get(0)) {
                this._options = {
                    autoplay: false,
                    carousel: true,
                    carouselFollow: true,
                    carouselSpeed: 400,
                    carouselSteps: "auto",
                    clicknext: false,
                    dataConfig: function () {
                        return {}
                    },
                    dataSelector: "img",
                    dataSource: this._target,
                    debug: void 0,
                    easing: "galleria",
                    extend: function () {},
                    height: "auto",
                    idleTime: 3E3,
                    idleSpeed: 200,
                    imageCrop: false,
                    imageMargin: 0,
                    imagePan: false,
                    imagePanSmoothness: 12,
                    imagePosition: "50%",
                    keepSource: false,
                    lightbox: false,
                    lightboxFadeSpeed: 200,
                    lightboxTransitionSpeed: 400,
                    linkSourceTmages: true,
                    maxScaleRatio: void 0,
                    minScaleRatio: void 0,
                    overlayOpacity: 0.85,
                    overlayBackground: "#0b0b0b",
                    pauseOnInteraction: true,
                    popupLinks: false,
                    preload: 2,
                    queue: true,
                    show: 0,
                    showInfo: true,
                    showCounter: true,
                    showImagenav: true,
                    thumbCrop: true,
                    thumbEventType: W(),
                    thumbFit: true,
                    thumbMargin: 0,
                    thumbQuality: "auto",
                    thumbnails: true,
                    transition: "fade",
                    transitionInitial: void 0,
                    transitionSpeed: 400,
                    width: "auto"
                };
                if (i && i.debug === true) L = true;
                j(this._target).children().hide();
                typeof t.theme === "object" ? this._init() : b.wait({
                    until: function () {
                        return typeof t.theme === "object"
                    },
                    success: function () {
                        m._init.call(m)
                    },
                    error: function () {
                        t.raise("No theme found.", true)
                    },
                    timeout: 5E3
                })
            } else t.raise("Target not found.")
        },
        _init: function () {
            var d = this;
            if (this._initialized) {
                t.raise("Init failed: Gallery instance already initialized.");
                return this
            }
            this._initialized = true;
            if (!t.theme) {
                t.raise("Init failed: No theme found.");
                return this
            }
            j.extend(true, this._options, t.theme.defaults, this._original.options);
            this.bind(t.DATA, function () {
                this._original.data = this._data;
                this.get("total").innerHTML = this.getDataLength();
                var i = this.$("container"),
                    m = {
                        width: 0,
                        height: 0
                    },
                    o = b.create("galleria-image");
                b.wait({
                    until: function () {
                        j.each(["width", "height"], function (C, F) {
                            m[F] = d._options[F] && typeof d._options[F] === "number" ? d._options[F] : Math.max(b.parseValue(i.css(F)), b.parseValue(d.$("target").css(F)), i[F](), d.$("target")[F]())
                        });
                        var z = function () {
                                return true
                            };
                        if (d._options.thumbnails) {
                            d.$("thumbnails").append(o);
                            z = function () {
                                return !!j(o).height()
                            }
                        }
                        return z() && m.width && m.height > 10
                    },
                    success: function () {
                        j(o).remove();
                        i.width(m.width);
                        i.height(m.height);
                        t.WEBKIT ? r.setTimeout(function () {
                            d._run()
                        }, 1) : d._run()
                    },
                    error: function () {
                        t.raise("Width & Height not found.", true)
                    },
                    timeout: 2E3
                })
            });
            this.bind(t.READY, function (i) {
                return function () {
                    b.show(this.get("counter"));
                    this._options.carousel && this._carousel.bindControls();
                    if (this._options.autoplay) {
                        this.pause();
                        if (typeof this._options.autoplay === "number") this._playtime = this._options.autoplay;
                        this.trigger(t.PLAY);
                        this._playing = true
                    }
                    if (i) typeof this._options.show === "number" && this.show(this._options.show);
                    else {
                        i = true;
                        if (this._options.clicknext) {
                            j.each(this._data, function (m, o) {
                                delete o.link
                            });
                            this.$("stage").css({
                                cursor: "pointer"
                            }).bind(W(), function () {
                                d._options.pauseOnInteraction && d.pause();
                                d.next()
                            })
                        }
                        t.History && t.History.change(function (m) {
                            m = parseInt(m.value.replace(/\//, ""), 10);
                            isNaN(m) ? r.history.go(-1) : d.show(m, void 0, true)
                        });
                        t.theme.init.call(this, this._options);
                        this._options.extend.call(this, this._options);
                        if (/^[0-9]{1,4}$/.test(V) && t.History) this.show(V, void 0, true);
                        else this._data[this._options.show] && this.show(this._options.show)
                    }
                }
            }(false));
            this.append({
                "info-text": ["info-title", "info-description"],
                info: ["info-text"],
                "image-nav": ["image-nav-right", "image-nav-left"],
                stage: ["images", "loader", "counter", "image-nav"],
                "thumbnails-list": ["thumbnails"],
                "thumbnails-container": ["thumb-nav-left", "thumbnails-list", "thumb-nav-right"],
                container: ["stage", "thumbnails-container", "info", "tooltip"]
            });
            b.hide(this.$("counter").append(this.get("current"), " / ", this.get("total")));
            this.setCounter("&#8211;");
            b.hide(d.get("tooltip"));
            j.each(Array(2), function (i) {
                var m = new t.Picture;
                j(m.container).css({
                    position: "absolute",
                    top: 0,
                    left: 0
                });
                d.$("images").append(m.container);
                d._controls[i] = m
            });
            this.$("images").css({
                position: "relative",
                top: 0,
                left: 0,
                width: "100%",
                height: "100%"
            });
            this.$("thumbnails, thumbnails-list").css({
                overflow: "hidden",
                position: "relative"
            });
            this.$("image-nav-right, image-nav-left").bind(W(), function (i) {
                d._options.clicknext && i.stopPropagation();
                d._options.pauseOnInteraction && d.pause();
                i = /right/.test(this.className) ? "next" : "prev";
                d[i]()
            });
            j.each(["info", "counter", "image-nav"], function (i, m) {
                d._options["show" + m.substr(0, 1).toUpperCase() + m.substr(1).replace(/-/, "")] === false && b.moveOut(d.get(m.toLowerCase()))
            });
            this.load();
            if (!this._options.keep_source && !M) this._target.innerHTML = "";
            this.$("target").append(this.get("container"));
            this._options.carousel && this.bind(t.THUMBNAIL, function () {
                this.updateCarousel()
            });
            return this
        },
        _createThumbnails: function () {
            this.get("total").innerHTML = this.getDataLength();
            var d, i, m, o, z, C = this,
                F = this._options,
                E = function () {
                    var P = C.$("thumbnails").find(".active");
                    if (!P.length) return false;
                    return P.find("img").attr("src")
                }(),
                p = typeof F.thumbnails === "string" ? F.thumbnails.toLowerCase() : null,
                v = function (P) {
                    return u.defaultView && u.defaultView.getComputedStyle ? u.defaultView.getComputedStyle(m.container, null)[P] : z.css(P)
                },
                H = function (P, R, da) {
                    return function () {
                        j(da).append(P);
                        C.trigger({
                            type: t.THUMBNAIL,
                            thumbTarget: P,
                            index: R
                        })
                    }
                },
                J = function (P) {
                    F.pauseOnInteraction && C.pause();
                    var R = j(P.currentTarget).data("index");
                    C.getIndex() !== R && C.show(R);
                    P.preventDefault()
                },
                K = function (P) {
                    P.scale({
                        width: P.data.width,
                        height: P.data.height,
                        crop: F.thumbCrop,
                        margin: F.thumbMargin,
                        complete: function (R) {
                            var da = ["left", "top"],
                                $, la;
                            j.each(["Width", "Height"], function (oa, pa) {
                                $ = pa.toLowerCase();
                                if ((F.thumbCrop !== true || F.thumbCrop === $) && F.thumbFit) {
                                    la = {};
                                    la[$] = R[$];
                                    j(R.container).css(la);
                                    la = {};
                                    la[da[oa]] = 0;
                                    j(R.image).css(la)
                                }
                                R["outer" + pa] = j(R.container)["outer" + pa](true)
                            });
                            b.toggleQuality(R.image, F.thumbQuality === true || F.thumbQuality === "auto" && R.original.width < R.width * 3);
                            C.trigger({
                                type: t.THUMBNAIL,
                                thumbTarget: R.image,
                                index: R.data.order
                            })
                        }
                    })
                };
            this._thumbnails = [];
            this.$("thumbnails").empty();
            for (d = 0; this._data[d]; d++) {
                o = this._data[d];
                if (F.thumbnails === true) {
                    m = new t.Picture(d);
                    i = o.thumb || o.image;
                    this.$("thumbnails").append(m.container);
                    z = j(m.container);
                    m.data = {
                        width: b.parseValue(v("width")),
                        height: b.parseValue(v("height")),
                        order: d
                    };
                    F.thumbFit && F.thumbCrop !== true ? z.css({
                        width: 0,
                        height: 0
                    }) : z.css({
                        width: m.data.width,
                        height: m.data.height
                    });
                    m.load(i, K);
                    F.preload === "all" && m.add(o.image)
                } else if (p === "empty" || p === "numbers") {
                    m = {
                        container: b.create("galleria-image"),
                        image: b.create("img", "span"),
                        ready: true
                    };
                    p === "numbers" && j(m.image).text(d + 1);
                    this.$("thumbnails").append(m.container);
                    r.setTimeout(H(m.image, d, m.container), 50 + d * 20)
                } else m = {
                    container: null,
                    image: null
                };
                j(m.container).add(F.keepSource && F.linkSourceImages ? o.original : null).data("index", d).bind(F.thumbEventType, J);
                E === i && j(m.container).addClass("active");
                this._thumbnails.push(m)
            }
        },
        _run: function () {
            var d = this;
            d._createThumbnails();
            b.wait({
                until: function () {
                    t.OPERA && d.$("stage").css("display", "inline-block");
                    d._stageWidth = d.$("stage").width();
                    d._stageHeight = d.$("stage").height();
                    return d._stageWidth && d._stageHeight > 50
                },
                success: function () {
                    d.trigger(t.READY)
                },
                error: function () {
                    t.raise("Stage measures not found", true)
                }
            })
        },
        load: function (d, i, m) {
            var o = this;
            this._data = [];
            this._thumbnails = [];
            this.$("thumbnails").empty();
            if (typeof i === "function") {
                m = i;
                i = null
            }
            d = d || this._options.dataSource;
            i = i || this._options.dataSelector;
            m = m || this._options.dataConfig;
            if (d.constructor === Array) {
                if (this.validate(d)) {
                    this._data = d;
                    this._parseData().trigger(t.DATA)
                } else t.raise("Load failed: JSON Array not valid.");
                return this
            }
            j(d).find(i).each(function (z, C) {
                C = j(C);
                var F = {},
                    E = C.parent().attr("href");
                if (/\.(png|gif|jpg|jpeg)(\?.*)?$/i.test(E)) F.image = F.big = E;
                else if (E) F.link = E;
                o._data.push(j.extend({
                    title: C.attr("title"),
                    thumb: C.attr("src"),
                    image: C.attr("src"),
                    big: C.attr("src"),
                    description: C.attr("alt"),
                    link: C.attr("longdesc"),
                    original: C.get(0)
                }, F, m(C)))
            });
            this.getDataLength() ? this.trigger(t.DATA) : t.raise("Load failed: no data found.");
            return this
        },
        _parseData: function () {
            var d = this;
            j.each(this._data, function (i, m) {
                if ("thumb" in m === false) d._data[i].thumb = m.image;
                if (false in m) d._data[i].big = m.image
            });
            return this
        },
        splice: function () {
            Array.prototype.splice.apply(this._data, b.array(arguments));
            return this._parseData()._createThumbnails()
        },
        push: function () {
            Array.prototype.push.apply(this._data, b.array(arguments));
            return this._parseData()._createThumbnails()
        },
        _getActive: function () {
            return this._controls.getActive()
        },
        validate: function () {
            return true
        },
        bind: function (d, i) {
            d = ea(d);
            this.$("container").bind(d, this.proxy(i));
            return this
        },
        unbind: function (d) {
            d = ea(d);
            this.$("container").unbind(d);
            return this
        },
        trigger: function (d) {
            d = typeof d === "object" ? j.extend(d, {
                scope: this
            }) : {
                type: ea(d),
                scope: this
            };
            this.$("container").trigger(d);
            return this
        },
        addIdleState: function () {
            this._idle.add.apply(this._idle, b.array(arguments));
            return this
        },
        removeIdleState: function () {
            this._idle.remove.apply(this._idle, b.array(arguments));
            return this
        },
        enterIdleMode: function () {
            this._idle.hide();
            return this
        },
        exitIdleMode: function () {
            this._idle.showAll();
            return this
        },
        enterFullscreen: function () {
            this._fullscreen.enter.apply(this, b.array(arguments));
            return this
        },
        exitFullscreen: function () {
            this._fullscreen.exit.apply(this, b.array(arguments));
            return this
        },
        toggleFullscreen: function () {
            this._fullscreen[this.isFullscreen() ? "exit" : "enter"].apply(this, b.array(arguments));
            return this
        },
        bindTooltip: function () {
            this._tooltip.bind.apply(this._tooltip, b.array(arguments));
            return this
        },
        defineTooltip: function () {
            this._tooltip.define.apply(this._tooltip, b.array(arguments));
            return this
        },
        refreshTooltip: function () {
            this._tooltip.show.apply(this._tooltip, b.array(arguments));
            return this
        },
        openLightbox: function () {
            this._lightbox.show.apply(this._lightbox, b.array(arguments));
            return this
        },
        closeLightbox: function () {
            this._lightbox.hide.apply(this._lightbox, b.array(arguments));
            return this
        },
        getActiveImage: function () {
            return this._getActive().image || void 0
        },
        getActiveThumb: function () {
            return this._thumbnails[this._active].image || void 0
        },
        getMousePosition: function (d) {
            return {
                x: d.pageX - this.$("container").offset().left,
                y: d.pageY - this.$("container").offset().top
            }
        },
        addPan: function (d) {
            if (this._options.imageCrop !== false) {
                d = j(d || this.getActiveImage());
                var i = this,
                    m = d.width() / 2,
                    o = d.height() / 2,
                    z = parseInt(d.css("left"), 10),
                    C = parseInt(d.css("top"), 10),
                    F = z || 0,
                    E = C || 0,
                    p = 0,
                    v = 0,
                    H = false,
                    J = b.timestamp(),
                    K = 0,
                    P = 0,
                    R = function ($, la, oa) {
                        if ($ > 0) {
                            P = Math.round(Math.max($ * -1, Math.min(0, la)));
                            if (K !== P) {
                                K = P;
                                if (M === 8) d.parent()["scroll" + oa](P * -1);
                                else {
                                    $ = {};
                                    $[oa.toLowerCase()] = P;
                                    d.css($)
                                }
                            }
                        }
                    },
                    da = function ($) {
                        if (!(b.timestamp() - J < 50)) {
                            H = true;
                            m = i.getMousePosition($).x;
                            o = i.getMousePosition($).y
                        }
                    };
                if (M === 8) {
                    d.parent().scrollTop(E * -1).scrollLeft(F * -1);
                    d.css({
                        top: 0,
                        left: 0
                    })
                }
                this.$("stage").unbind("mousemove", da).bind("mousemove", da);
                b.addTimer("pan", function () {
                    if (H) {
                        p = d.width() - i._stageWidth;
                        v = d.height() - i._stageHeight;
                        z = m / i._stageWidth * p * -1;
                        C = o / i._stageHeight * v * -1;
                        F += (z - F) / i._options.imagePanSmoothness;
                        E += (C - E) / i._options.imagePanSmoothness;
                        R(v, E, "Top");
                        R(p, F, "Left")
                    }
                }, 50, true);
                return this
            }
        },
        proxy: function (d, i) {
            if (typeof d !== "function") return function () {};
            i = i || this;
            return function () {
                return d.apply(i, b.array(arguments))
            }
        },
        removePan: function () {
            this.$("stage").unbind("mousemove");
            b.clearTimer("pan");
            return this
        },
        addElement: function () {
            var d = this._dom;
            j.each(b.array(arguments), function (i, m) {
                d[m] = b.create("galleria-" + m)
            });
            return this
        },
        attachKeyboard: function () {
            this._keyboard.attach.apply(this._keyboard, b.array(arguments));
            return this
        },
        detachKeyboard: function () {
            this._keyboard.detach.apply(this._keyboard, b.array(arguments));
            return this
        },
        appendChild: function (d, i) {
            this.$(d).append(this.get(i) || i);
            return this
        },
        prependChild: function (d, i) {
            this.$(d).prepend(this.get(i) || i);
            return this
        },
        remove: function () {
            this.$(b.array(arguments).join(",")).remove();
            return this
        },
        append: function (d) {
            var i, m;
            for (i in d) if (d.hasOwnProperty(i)) if (d[i].constructor === Array) for (m = 0; d[i][m]; m++) this.appendChild(i, d[i][m]);
            else this.appendChild(i, d[i]);
            return this
        },
        _scaleImage: function (d, i) {
            i = j.extend({
                width: this._stageWidth,
                height: this._stageHeight,
                crop: this._options.imageCrop,
                max: this._options.maxScaleRatio,
                min: this._options.minScaleRatio,
                margin: this._options.imageMargin,
                position: this._options.imagePosition
            }, i);
            (d || this._controls.getActive()).scale(i);
            return this
        },
        updateCarousel: function () {
            this._carousel.update();
            return this
        },
        rescale: function (d, i, m) {
            var o = this;
            if (typeof d === "function") {
                m = d;
                d = void 0
            }
            var z = function () {
                    o._stageWidth = d || o.$("stage").width();
                    o._stageHeight = i || o.$("stage").height();
                    o._scaleImage();
                    o._options.carousel && o.updateCarousel();
                    o.trigger(t.RESCALE);
                    typeof m === "function" && m.call(o)
                };
            t.WEBKIT && !d && !i ? b.addTimer("scale", z, 5) : z.call(o);
            return this
        },
        refreshImage: function () {
            this._scaleImage();
            this._options.imagePan && this.addPan();
            return this
        },
        show: function (d, i, m) {
            if (!(d === false || !this._options.queue && this._queue.stalled)) {
                d = Math.max(0, Math.min(parseInt(d, 10), this.getDataLength() - 1));
                i = typeof i !== "undefined" ? !! i : d < this.getIndex();
                if (!m && t.History) t.History.value(d.toString());
                else {
                    this._active = d;
                    Array.prototype.push.call(this._queue, {
                        index: d,
                        rewind: i
                    });
                    this._queue.stalled || this._show();
                    return this
                }
            }
        },
        _show: function () {
            var d = this,
                i = this._queue[0],
                m = this.getData(i.index);
            if (m) {
                var o = this.isFullscreen() && "big" in m ? m.big : m.image,
                    z = this._controls.getActive(),
                    C = this._controls.getNext(),
                    F = C.isCached(o),
                    E = this._thumbnails[i.index],
                    p = function () {
                        d._queue.stalled = false;
                        b.toggleQuality(C.image, d._options.imageQuality);
                        j(z.container).css({
                            zIndex: 0,
                            opacity: 0
                        });
                        j(C.container).css({
                            zIndex: 1,
                            opacity: 1
                        });
                        d._controls.swap();
                        d._options.imagePan && d.addPan(C.image);
                        if (m.link || d._options.lightbox) j(C.image).css({
                            cursor: "pointer"
                        }).bind(W(), function () {
                            if (m.link) if (d._options.popupLinks) r.open(m.link, "_blank");
                            else r.location.href = m.link;
                            else d.openLightbox()
                        });
                        Array.prototype.shift.call(d._queue);
                        d._queue.length && d._show();
                        d._playCheck();
                        d.trigger({
                            type: t.IMAGE,
                            index: i.index,
                            imageTarget: C.image,
                            thumbTarget: E.image
                        })
                    };
                this._options.carousel && this._options.carouselFollow && this._carousel.follow(i.index);
                if (this._options.preload) {
                    var v, H, J = this.getNext();
                    try {
                        for (H = this._options.preload; H > 0; H--) {
                            v = new t.Picture;
                            m = d.getData(J);
                            v.add(this.isFullscreen() && "big" in m ? m.big : m.image);
                            J = d.getNext(J)
                        }
                    } catch (K) {}
                }
                b.show(C.container);
                j(d._thumbnails[i.index].container).addClass("active").siblings(".active").removeClass("active");
                d.trigger({
                    type: t.LOADSTART,
                    cached: F,
                    index: i.index,
                    imageTarget: C.image,
                    thumbTarget: E.image
                });
                C.load(o, function (P) {
                    d._scaleImage(P, {
                        complete: function (R) {
                            b.show(R.container);
                            "image" in z && b.toggleQuality(z.image, false);
                            b.toggleQuality(R.image, false);
                            d._queue.stalled = true;
                            d.removePan();
                            d.setInfo(i.index);
                            d.setCounter(i.index);
                            d.trigger({
                                type: t.LOADFINISH,
                                cached: F,
                                index: i.index,
                                imageTarget: R.image,
                                thumbTarget: d._thumbnails[i.index].image
                            });
                            var da = z.image === null && d._options.transitionInitial ? d._options.transitionInitial : d._options.transition;
                            da in ka === false ? p() : ka[da].call(d, {
                                prev: z.image,
                                next: R.image,
                                rewind: i.rewind,
                                speed: d._options.transitionSpeed || 400
                            }, p)
                        }
                    })
                })
            }
        },
        getNext: function (d) {
            d = typeof d === "number" ? d : this.getIndex();
            return d === this.getDataLength() - 1 ? 0 : d + 1
        },
        getPrev: function (d) {
            d = typeof d === "number" ? d : this.getIndex();
            return d === 0 ? this.getDataLength() - 1 : d - 1
        },
        next: function () {
            this.getDataLength() > 1 && this.show(this.getNext(), false);
            return this
        },
        prev: function () {
            this.getDataLength() > 1 && this.show(this.getPrev(), true);
            return this
        },
        get: function (d) {
            return d in this._dom ? this._dom[d] : null
        },
        getData: function (d) {
            return d in this._data ? this._data[d] : this._data[this._active]
        },
        getDataLength: function () {
            return this._data.length
        },
        getIndex: function () {
            return typeof this._active === "number" ? this._active : false
        },
        getStageHeight: function () {
            return this._stageHeight
        },
        getStageWidth: function () {
            return this._stageWidth
        },
        getOptions: function (d) {
            return typeof d === "undefined" ? this._options : this._options[d]
        },
        setOptions: function (d, i) {
            if (typeof d === "object") j.extend(this._options, d);
            else this._options[d] = i;
            return this
        },
        play: function (d) {
            this._playing = true;
            this._playtime = d || this._playtime;
            this._playCheck();
            this.trigger(t.PLAY);
            return this
        },
        pause: function () {
            this._playing = false;
            this.trigger(t.PAUSE);
            return this
        },
        playToggle: function (d) {
            return this._playing ? this.pause() : this.play(d)
        },
        isPlaying: function () {
            return this._playing
        },
        isFullscreen: function () {
            return this._fullscreen.active
        },
        _playCheck: function () {
            var d = this,
                i = 0,
                m = b.timestamp(),
                o = "play" + this._id;
            if (this._playing) {
                b.clearTimer(o);
                var z = function () {
                        i = b.timestamp() - m;
                        if (i >= d._playtime && d._playing) {
                            b.clearTimer(o);
                            d.next()
                        } else if (d._playing) {
                            d.trigger({
                                type: t.PROGRESS,
                                percent: Math.ceil(i / d._playtime * 100),
                                seconds: Math.floor(i / 1E3),
                                milliseconds: i
                            });
                            b.addTimer(o, z, 20)
                        }
                    };
                b.addTimer(o, z, 20)
            }
        },
        setIndex: function (d) {
            this._active = d;
            return this
        },
        setCounter: function (d) {
            if (typeof d === "number") d++;
            else if (typeof d === "undefined") d = this.getIndex() + 1;
            this.get("current").innerHTML = d;
            if (M) {
                d = this.$("counter");
                var i = d.css("opacity"),
                    m = d.attr("style");
                m && parseInt(i, 10) === 1 ? d.attr("style", m.replace(/filter[^\;]+\;/i, "")) : this.$("counter").css("opacity", i)
            }
            return this
        },
        setInfo: function (d) {
            var i = this,
                m = this.getData(d);
            j.each(["title", "description"], function (o, z) {
                var C = i.$("info-" + z);
                m[z] ? C[m[z].length ? "show" : "hide"]().html(m[z]) : C.empty().hide()
            });
            return this
        },
        hasInfo: function (d) {
            var i = "title description".split(" "),
                m;
            for (m = 0; i[m]; m++) if (this.getData(d)[i[m]]) return true;
            return false
        },
        jQuery: function (d) {
            var i = this,
                m = [];
            j.each(d.split(","), function (z, C) {
                C = j.trim(C);
                i.get(C) && m.push(C)
            });
            var o = j(i.get(m.shift()));
            j.each(m, function (z, C) {
                o = o.add(i.get(C))
            });
            return o
        },
        $: function () {
            return this.jQuery.apply(this, b.array(arguments))
        }
    };
    j.each(ga, function (d, i) {
        var m = /_/.test(i) ? i.replace(/_/g, "") : i;
        t[i.toUpperCase()] = "galleria." + m
    });
    j.extend(t, {
        IE9: M === 9,
        IE8: M === 8,
        IE7: M === 7,
        IE6: M === 6,
        IE: !! M,
        WEBKIT: /webkit/.test(I),
        SAFARI: /safari/.test(I),
        CHROME: /chrome/.test(I),
        QUIRK: M && u.compatMode && u.compatMode === "BackCompat",
        MAC: /mac/.test(navigator.platform.toLowerCase()),
        OPERA: !! r.opera,
        IPHONE: /iphone/.test(I),
        IPAD: /ipad/.test(I),
        ANDROID: /android/.test(I),
        TOUCH: !! (/iphone/.test(I) || /ipad/.test(I) || /android/.test(I))
    });
    t.addTheme = function (d) {
        d.name || t.raise("No theme name specified");
        d.defaults = typeof d.defaults !== "object" ? {} : T(d.defaults);
        var i = false,
            m;
        if (typeof d.css === "string") {
            j("link").each(function (o, z) {
                m = RegExp(d.css);
                if (m.test(z.href)) {
                    i = true;
                    t.theme = d;
                    return false
                }
            });
            i || j("script").each(function (o, z) {
                m = RegExp("galleria\\." + d.name.toLowerCase() + "\\.");
                if (m.test(z.src)) {
                    i = z.src.replace(/[^\/]*$/, "") + d.css;
                    b.addTimer("css", function () {
                        b.loadCSS(i, "galleria-theme", function () {
                            t.theme = d
                        })
                    }, 1)
                }
            });
            i || t.raise("No theme CSS loaded")
        } else t.theme = d;
        return d
    };
    t.loadTheme = function (d, i) {
        var m = false,
            o = fa.length;
        t.theme = void 0;
        b.loadScript(d, function () {
            m = true
        });
        b.wait({
            until: function () {
                return m
            },
            error: function () {
                t.raise("Theme at " + d + " could not load, check theme path.", true)
            },
            success: function () {
                if (o) {
                    var z = [];
                    j.each(t.get(), function (C, F) {
                        var E = j.extend(F._original.options, {
                            data_source: F._data
                        }, i);
                        F.$("container").remove();
                        var p = new t;
                        p._id = F._id;
                        p.init(F._original.target, E);
                        z.push(p)
                    });
                    fa = z
                }
            },
            timeout: 2E3
        })
    };
    t.get = function (d) {
        if (fa[d]) return fa[d];
        else if (typeof d !== "number") return fa;
        else t.raise("Gallery index " + d + " not found")
    };
    t.addTransition = function (d, i) {
        ka[d] = i
    };
    t.utils = b;
    t.log = function () {
        try {
            r.console.log.apply(r.console, b.array(arguments))
        } catch (d) {
            try {
                r.opera.postError.apply(r.opera, arguments)
            } catch (i) {
                r.alert(b.array(arguments).split(", "))
            }
        }
    };
    t.raise = function (d, i) {
        if (L || i) throw Error((i ? "Fatal error" : "Error") + ": " + d);
    };
    t.Picture = function (d) {
        this.id = d || null;
        this.image = null;
        this.container = b.create("galleria-image");
        j(this.container).css({
            overflow: "hidden",
            position: "relative"
        });
        this.original = {
            width: 0,
            height: 0
        };
        this.loaded = this.ready = false
    };
    t.Picture.prototype = {
        cache: {},
        add: function (d) {
            var i = 0,
                m = this,
                o = new Image,
                z = function () {
                    if ((!this.width || !this.height) && i < 1E3) {
                        i++;
                        j(o).load(z).attr("src", d + "?" + (new Date).getTime())
                    }
                    m.original = {
                        height: this.height,
                        width: this.width
                    };
                    m.cache[d] = d;
                    m.loaded = true
                };
            j(o).css("display", "block");
            if (m.cache[d]) {
                o.src = d;
                z.call(o);
                return o
            }
            j(o).load(z).attr("src", d);
            return o
        },
        show: function () {
            b.show(this.image)
        },
        hide: function () {
            b.moveOut(this.image)
        },
        clear: function () {
            this.image = null
        },
        isCached: function (d) {
            return !!this.cache[d]
        },
        load: function (d, i) {
            var m = this;
            j(this.container).empty(true);
            this.image = this.add(d);
            b.hide(this.image);
            j(this.container).append(this.image);
            b.wait({
                until: function () {
                    return m.loaded && m.image.complete && m.original.width && m.image.width
                },
                success: function () {
                    r.setTimeout(function () {
                        i.call(m, m)
                    }, 50)
                },
                error: function () {
                    r.setTimeout(function () {
                        i.call(m, m)
                    }, 50);
                    t.raise("image not loaded in 30 seconds: " + d)
                },
                timeout: 3E4
            });
            return this.container
        },
        scale: function (d) {
            d = j.extend({
                width: 0,
                height: 0,
                min: void 0,
                max: void 0,
                margin: 0,
                complete: function () {},
                position: "center",
                crop: false
            }, d);
            if (!this.image) return this.container;
            var i, m, o = this,
                z = j(o.container);
            b.wait({
                until: function () {
                    i = d.width || z.width() || b.parseValue(z.css("width"));
                    m = d.height || z.height() || b.parseValue(z.css("height"));
                    return i && m
                },
                success: function () {
                    var C = (i - d.margin * 2) / o.original.width,
                        F = (m - d.margin * 2) / o.original.height,
                        E = {
                            "true": Math.max(C, F),
                            width: C,
                            height: F,
                            "false": Math.min(C, F)
                        }[d.crop.toString()];
                    if (d.max) E = Math.min(d.max, E);
                    if (d.min) E = Math.max(d.min, E);
                    j(o.container).width(i).height(m);
                    j.each(["width", "height"], function (J, K) {
                        j(o.image)[K](o.image[K] = o[K] = Math.round(o.original[K] * E))
                    });
                    var p = {},
                        v = {};
                    C = function (J, K, P) {
                        var R = 0;
                        if (/\%/.test(J)) {
                            J = parseInt(J, 10) / 100;
                            K = o.image[K] || j(o.image)[K]();
                            R = Math.ceil(K * -1 * J + P * J)
                        } else R = b.parseValue(J);
                        return R
                    };
                    var H = {
                        top: {
                            top: 0
                        },
                        left: {
                            left: 0
                        },
                        right: {
                            left: "100%"
                        },
                        bottom: {
                            top: "100%"
                        }
                    };
                    j.each(d.position.toLowerCase().split(" "), function (J, K) {
                        if (K === "center") K = "50%";
                        p[J ? "top" : "left"] = K
                    });
                    j.each(p, function (J, K) {
                        H.hasOwnProperty(K) && j.extend(v, H[K])
                    });
                    p = p.top ? j.extend(p, v) : v;
                    p = j.extend({
                        top: "50%",
                        left: "50%"
                    }, p);
                    j(o.image).css({
                        position: "relative",
                        top: C(p.top, "height", m),
                        left: C(p.left, "width", i)
                    });
                    o.show();
                    o.ready = true;
                    d.complete.call(o, o)
                },
                error: function () {
                    t.raise("Could not scale image: " + o.image.src)
                },
                timeout: 1E3
            });
            return this
        }
    };
    j.extend(j.easing, {
        galleria: function (d, i, m, o, z) {
            if ((i /= z / 2) < 1) return o / 2 * i * i * i * i + m;
            return -o / 2 * ((i -= 2) * i * i * i - 2) + m
        },
        galleriaIn: function (d, i, m, o, z) {
            return o * (i /= z) * i * i * i + m
        },
        galleriaOut: function (d, i, m, o, z) {
            return -o * ((i = i / z - 1) * i * i * i - 1) + m
        }
    });
    j.fn.galleria = function (d) {
        return this.each(function () {
            (new t).init(this, d)
        })
    };
    r.Galleria = t
})(jQuery);



/**
	Demo portion

*/
(function (j) {
    var r = {
        prototyping: function () {
            j('img[src="#"]').attr("src", "cust/placeholder.png").addClass("placeholder").each(function () {
                this.width -= 2;
                this.height -= 2
            });
            j('a[href="#"]').click(function (u) {
                u.preventDefault()
            })
        },
        BROWSER: {
            IE: function () {
                for (var u = 3, O = document.createElement("div"); O.innerHTML = "<\!--[if gt IE " + ++u + "]><i></i><![endif]--\>", O.getElementsByTagName("i")[0];);
                return u > 4 ? u : void 0
            }()
        }
    };
    window.Aino = r;
    window.STATIC_URL = "Images/";
    window.THEMES_URL = "../css/"
})(jQuery);
var G_DEMO_IMAGES = [{
    title: "Manzanar birds on wire",
    thumb: STATIC_URL + "00_m.jpg",
    image: STATIC_URL + "00.jpg",
    description: "Birds on wire, evening, Manzanar Relocation Center / photograph by Ansel Adams."
}, {
    title: "Antarctic Sunset",
    thumb: STATIC_URL + "12_m.jpg",
    image: STATIC_URL + "12.jpg",
    description: "An Antarctic Sunset, photo taken by Calee Allen on April 6th, 2008."
}, {
    title: "Locomotives Roundhouse",
    thumb: STATIC_URL + "01_m.jpg",
    image: STATIC_URL + "01.jpg",
    description: "Steam locomotives of the Chicago & North Western Railway."
}, {
    title: "Braunwald Alps",
    thumb: STATIC_URL + "11_m.jpg",
    image: STATIC_URL + "11.jpg",
    description: "View from Braunwald, Switzerland."
}, {
    title: "Icebergs in the High Arctic",
    thumb: STATIC_URL + "02_m.jpg",
    image: STATIC_URL + "02.jpg",
    description: "\u201dThe debris loading isn't particularly extensive, but the color is usual.\u201d"
}, {
    title: "Ara\u00f1a",
    thumb: STATIC_URL + "03_m.jpg",
    image: STATIC_URL + "03.jpg",
    description: "Xysticus cristatus, A Estrada, Galicia, Spain"
}, {
    title: "Museo storia naturale",
    thumb: STATIC_URL + "04_m.jpg",
    image: STATIC_URL + "04.jpg"
}, {
    title: "Grj\u00f3tagj\u00e1 caves in summer 2009",
    thumb: STATIC_URL + "05_m.jpg",
    image: STATIC_URL + "05.jpg"
}, {
    title: "Thermes",
    thumb: STATIC_URL + "06_m.jpg",
    image: STATIC_URL + "06.jpg",
    description: "Xanthi hot-spa springs, Xanthi Prefecture, Greece"
}, {
    title: "Polish Army Ko\u0142obrzeg",
    thumb: STATIC_URL + "07_m.jpg",
    image: STATIC_URL + "07.jpg",
    description: "A display of the Polish Army. Both the soldier, and the vehicle belong to the 7th Pomeranian Coastal Defence Brigade, a part of the Szczecin-based 12th Mechanized Division \u201dBoles\u0142aw Krzywousty\u201d"
}, {
    title: "Zlatograd Bulgaria",
    thumb: STATIC_URL + "08_m.jpg",
    image: STATIC_URL + "08.jpg"
}, {
    title: "09-28-2001 in New York City",
    thumb: STATIC_URL + "09_m.jpg",
    image: STATIC_URL + "09.jpg",
    description: "New York, NY, September 28, 2001 -- Debris on surrounding roofs at the site of the World Trade Center. Photo by Andrea Booher/ FEMA News Photo"
}, {
    thumb: STATIC_URL + "10_m.jpg",
    image: STATIC_URL + "10.jpg"
}];
(function (j, r, u) {
    var O = [],
        L = j.G = {
            init: function (I) {
                this.views._global.call(this);
                for (var V = document.body.className.split(" "), W = 0; W < V.length; W++) V[W] in this.views && this.views[V[W]].call(this);
                typeof I === "number" && L.run(I)
            },
            make: function (I, V) {
                O[I] = V
            },
            run: function (I, V, W) {
                V = V || "#demo";
                W = W ||
                function () {};
                u.theme = O[I];
                u.utils.loadCSS(THEMES_URL + I + ".css", "galleria-theme", function () {
                    r(V).galleria({
                        data_source: G_DEMO_IMAGES,
                        extend: function (M) {
                            W.call(this, M)
                        }
                    })
                })
            },
            views: {
                _global: function () {
                    r("a:path").addClass("active");
                    r(".secondary .box li:last").addClass("last")
                },
                home: function () {
                    L.run(1, "#demo", function (I) {
                        var V = true,
                            W = this.$("container"),
                            M = r("<div>").attr("id", "tagline").hide().html("<span>Galleria is a free multi-theme image gallery framework</span><br><span>for modern web publishing on all platforms.</span><br>");
                        W.append(M);
                        this.bind("loadfinish", function () {
                            if (V === true) {
                                V = false;
                                M.fadeIn(I.transitionSpeed)
                            } else if (V === false) {
                                V = null;
                                M.fadeOut(100)
                            }
                        })
                    })
                },
                tp: function () {
                    var I = r("#themes");
                    r("#theme-switcher").click(function () {
                        I.toggle()
                    }).trigger("click")
                },
                docs: function () {},
                "theme-purchase": function () {
                    r("input[type=image]").each(function () {
                        var I = r("<a>", {
                            href: "",
                            html: "Buy Now <span>$" + r(this).siblings('[name|="amount"]').val() + "</span>",
                            click: function (V) {
                                V.preventDefault();
                                V = r(this).closest("form");
                                V.length && V.submit()
                            }
                        });
                        r(this).replaceWith(I);
                        I.wrap('<div class="btn" />')
                    })
                }
            }
        };
    j.G = L
})(window, jQuery, Galleria);
(function (j) {
    G.make(0, {
        defaults: {
            transition: "pulse",
            thumbCrop: true,
            imageCrop: true,
            carousel: false,
            imagePan: true,
            clicknext: true,
            _locale: {
                enter_fullscreen: "Enter fullscreen",
                exit_fullscreen: "Exit fullscreen",
                click_to_close: "Click to close",
                show_thumbnails: "Show thumbnails",
                show_info: "Show info"
            }
        },
        init: function (r) {
            var u = this,
                O = false,
                L;
            L = 0;
            var I, V, W;
            this.addElement("desc", "dots", "thumbs", "fs", "more");
            this.append({
                container: ["desc", "dots", "thumbs", "fs", "info-description", "more"]
            });
            W = this.$("thumbnails-container").hide().css("visibility", "visible");
            for (L = 0; L < this.getDataLength(); L++) this.$("dots").append(j("<div>").click(function (M) {
                return function (Z) {
                    Z.preventDefault();
                    u.show(M)
                }
            }(L)));
            L = this.$("dots").outerWidth();
            I = this.$("desc").hide().hover(function () {
                j(this).addClass("hover")
            }, function () {
                j(this).removeClass("hover")
            }).click(function () {
                j(this).hide()
            });
            V = this.$("loader");
            this.bindTooltip({
                fs: function () {
                    return O ? r._locale.exit_fullscreen : r._locale.enter_fullscreen
                },
                desc: r._locale.click_to_close,
                more: r._locale.show_info,
                thumbs: r._locale.show_thumbnails
            });
            this.bind("loadstart", function (M) {
                M.cached || this.$("loader").show().fadeTo(200, 0.4)
            });
            this.bind("loadfinish", function (M) {
                var Z = u.getData().title,
                    ga = u.getData().description;
                I.hide();
                V.fadeOut(200);
                this.$("dots").children("div").eq(M.index).addClass("active").siblings(".active").removeClass("active");
                if (Z && ga) {
                    I.empty().append("<strong>" + Z + "</strong>", "<p>" + ga + "</p>").css({
                        marginTop: this.$("desc").outerHeight() / -2
                    });
                    this.$("more").show()
                } else this.$("more").hide();
                W.fadeOut(r.fadeSpeed);
                u.$("thumbs").removeClass("active")
            });
            this.bind("thumbnail", function (M) {
                j(M.thumbTarget).hover(function () {
                    u.setInfo(M.index)
                }, function () {
                    u.setInfo()
                })
            });
            this.$("fs").click(function () {
                u.toggleFullscreen();
                O = !O
            });
            this.$("thumbs").click(function (M) {
                M.preventDefault();
                W.toggle();
                j(this).toggleClass("active");
                I.hide()
            });
            this.$("more").click(function () {
                I.toggle()
            });
            this.$("info").css({
                width: this.getStageWidth() - L - 30,
                left: L + 10
            })
        }
    });
    G.make(1, {
        defaults: {
            transition: "pulse",
            transitionSpeed: 500,
            imageCrop: true,
            thumbCrop: true,
            carousel: false,
            _locale: {
                show_thumbnails: "Show thumbnails",
                hide_thumbnails: "Hide thumbnails",
                play: "Play slideshow",
                pause: "Pause slideshow",
                enter_fullscreen: "Enter fullscreen",
                exit_fullscreen: "Exit fullscreen",
                popout_image: "Popout image",
                showing_image: "Showing image %s of %s"
            },
            _showFullscreen: true,
            _showPopout: true,
            _showProgress: true,
            _showTooltip: true
        },
        init: function (r) {
            this.addElement("bar", "fullscreen", "play", "popout", "thumblink", "s1", "s2", "s3", "s4", "progress");
            this.append({
                stage: "progress",
                container: ["bar", "tooltip"],
                bar: ["fullscreen", "play", "popout", "thumblink", "info", "s1", "s2", "s3", "s4"]
            });
            this.prependChild("info", "counter");
            var u = this,
                O = this.$("thumbnails-container"),
                L = this.$("thumblink"),
                I = this.$("fullscreen"),
                V = this.$("play"),
                W = this.$("popout"),
                M = this.$("bar"),
                Z = this.$("progress"),
                ga = r.transition,
                T = r._locale,
                ea = false,
                ca = false,
                fa = !! r.autoplay,
                b = false,
                ka = function () {
                    O.height(u.getStageHeight()).width(u.getStageWidth()).css("top", ea ? 0 : u.getStageHeight() + 30)
                };
            ka();
            r._showTooltip && u.bindTooltip({
                thumblink: T.show_thumbnails,
                fullscreen: T.enter_fullscreen,
                play: T.play,
                popout: T.popout_image,
                caption: function () {
                    var t = u.getData(),
                        d = "";
                    if (t) {
                        if (t.title && t.title.length) d += "<strong>" + t.title + "</strong>";
                        if (t.description && t.description.length) d += "<br>" + t.description
                    }
                    return d
                },
                counter: function () {
                    return T.showing_image.replace(/\%s/, u.getIndex() + 1).replace(/\%s/, u.getDataLength())
                }
            });
            this.bind("play", function () {
                fa = true;
                V.addClass("playing")
            });
            this.bind("pause", function () {
                fa = false;
                V.removeClass("playing");
                Z.width(0)
            });
            r._showProgress && this.bind("progress", function (t) {
                Z.width(t.percent / 100 * this.getStageWidth())
            });
            this.bind("loadstart", function (t) {
                t.cached || this.$("loader").show()
            });
            this.bind("loadfinish", function () {
                Z.width(0);
                this.$("loader").hide();
                this.refreshTooltip("counter", "caption")
            });
            this.bind("thumbnail", function (t) {
                j(t.thumbTarget).hover(function () {
                    u.setInfo(t.thumbOrder);
                    u.setCounter(t.thumbOrder)
                }, function () {
                    u.setInfo();
                    u.setCounter()
                }).click(function () {
                    L.click()
                })
            });
            this.bind("fullscreen_enter", function () {
                ca = true;
                u.setOptions("transition", "none");
                I.addClass("open");
                M.css("bottom", 0);
                this.defineTooltip("fullscreen", T.exit_fullscreen);
                this.addIdleState(M, {
                    bottom: -31
                })
            });
            this.bind("fullscreen_exit", function () {
                ca = false;
                Galleria.utils.clearTimer("bar");
                u.setOptions("transition", ga);
                I.removeClass("open");
                M.css("bottom", 0);
                this.defineTooltip("fullscreen", T.enter_fullscreen);
                this.removeIdleState(M, {
                    bottom: -31
                })
            });
            this.bind("rescale", ka);
            this.addIdleState(this.get("image-nav-left"), {
                left: -36
            });
            this.addIdleState(this.get("image-nav-right"), {
                right: -36
            });
            L.click(function () {
                if (ea && b) u.play();
                else {
                    b = fa;
                    u.pause()
                }
                O.animate({
                    top: ea ? u.getStageHeight() + 30 : 0
                }, {
                    easing: "galleria",
                    duration: 400,
                    complete: function () {
                        u.defineTooltip("thumblink", ea ? T.show_thumbnails : T.hide_thumbnails);
                        L[ea ? "removeClass" : "addClass"]("open");
                        ea = !ea
                    }
                })
            });
            if (r._showPopout) W.click(function (t) {
                u.openLightbox();
                t.preventDefault()
            });
            else {
                W.remove();
                if (r._showFullscreen) {
                    this.$("s4").remove();
                    this.$("info").css("right", 40);
                    I.css("right", 0)
                }
            }
            V.click(function () {
                u.defineTooltip("play", fa ? T.play : T.pause);
                if (fa) u.pause();
                else {
                    ea && L.click();
                    u.play()
                }
            });
            if (r._showFullscreen) I.click(function () {
                ca ? u.exitFullscreen() : u.enterFullscreen()
            });
            else {
                I.remove();
                if (r._show_popout) {
                    this.$("s4").remove();
                    this.$("info").css("right", 40);
                    W.css("right", 0)
                }
            }
            if (!r._showFullscreen && !r._showPopout) {
                this.$("s3,s4").remove();
                this.$("info").css("right", 10)
            }
        }
    });
    G.make(2, {
        defaults: {
            transition: "none",
            imageCrop: true,
            thumbCrop: "height",
            easing: "galleriaOut",
            _hideDock: true,
            _closeOnClick: false
        },
        init: function (r) {
            this.addElement("thumbnails-tab");
            this.appendChild("thumbnails-container", "thumbnails-tab");
            var u = this.$("thumbnails-tab"),
                O = this.$("loader"),
                L = this.$("thumbnails-container"),
                I = this.$("thumbnails-list"),
                V = this.$("info-text"),
                W = this.$("info"),
                M = !r._hideDock,
                Z = 0;
            if (Galleria.IE) {
                this.addElement("iefix");
                this.appendChild("container", "iefix");
                this.$("iefix").css({
                    zIndex: 3,
                    position: "absolute",
                    backgroundColor: "#000",
                    opacity: 0.4,
                    top: 0
                })
            }
            r.thumbnails === false && L.hide();
            var ga = this.proxy(function (T) {
                if (T || T.width) {
                    T = Math.min(T.width, j(window).width());
                    V.width(T - 40);
                    Galleria.IE && this.getOptions("showInfo") && this.$("iefix").width(W.outerWidth()).height(W.outerHeight())
                }
            });
            this.bind("rescale", function () {
                Z = this.getStageHeight() - u.height() - 2;
                L.css("top", M ? Z - I.outerHeight() + 2 : Z);
                var T = this.getActiveImage();
                T && ga(T)
            });
            this.bind("loadstart", function (T) {
                T.cached || O.show().fadeTo(100, 1);
                j(T.thumbTarget).css("opacity", 1).parent().siblings().children().css("opacity", 0.6)
            });
            this.bind("loadfinish", function () {
                O.fadeOut(300);
                this.$("info, iefix").toggle(this.hasInfo())
            });
            this.bind("image", function (T) {
                ga(T.imageTarget)
            });
            this.bind("thumbnail", function (T) {
                j(T.thumbTarget).parent(":not(.active)").children().css("opacity", 0.6);
                j(T.thumbTarget).click(function () {
                    M && r._closeOnClick && u.click()
                })
            });
            this.trigger("rescale");
            this.addIdleState(L, {
                opacity: 0
            });
            this.addIdleState(this.get("info"), {
                opacity: 0
            });
            Galleria.IE && this.addIdleState(this.get("iefix"), {
                opacity: 0
            });
            this.$("image-nav-left, image-nav-right").css("opacity", 0.01).hover(function () {
                j(this).animate({
                    opacity: 1
                }, 100)
            }, function () {
                j(this).animate({
                    opacity: 0
                })
            }).show();
            if (r._hideDock) u.click(this.proxy(function () {
                u.toggleClass("open", !M);
                M ? L.animate({
                    top: Z
                }, 400, r.easing) : L.animate({
                    top: Z - I.outerHeight() + 2
                }, 400, r.easing);
                M = !M
            }));
            else {
                this.bind("thumbnail", function () {
                    L.css("top", Z - I.outerHeight() + 2)
                });
                u.css("visibility", "hidden")
            }
            this.$("thumbnails").children().hover(function () {
                j(this).not(".active").children().stop().fadeTo(100, 1)
            }, function () {
                j(this).not(".active").children().stop().fadeTo(400, 0.6)
            });
            this.enterFullscreen();
            this.attachKeyboard({
                escape: function () {
                    return false
                },
                up: function (T) {
                    M || u.click();
                    T.preventDefault()
                },
                down: function (T) {
                    M && u.click();
                    T.preventDefault()
                }
            })
        }
    });
    G.make(3, {
        defaults: {
            transition: "slide",
            thumbCrop: "height",
            _toggleInfo: true
        },
        init: function (r) {
            this.addElement("info-link", "info-close");
            this.append({
                info: ["info-link", "info-close"]
            });
            var u = this.$("info-link,info-close,info-text"),
                O = Galleria.TOUCH,
                L = O ? "touchstart" : "click";
            this.$("loader,counter").show().css("opacity", 0.4);
            if (!O) {
                this.addIdleState(this.get("image-nav-left"), {
                    left: -50
                });
                this.addIdleState(this.get("image-nav-right"), {
                    right: -50
                });
                this.addIdleState(this.get("counter"), {
                    opacity: 0
                })
            }
            if (r._toggleInfo === true) u.bind(L, function () {
                u.toggle()
            });
            else {
                u.show();
                this.$("info-link, info-close").hide()
            }
            this.bind("thumbnail", function (I) {
                if (!O) {
                    j(I.thumbTarget).css("opacity", 0.6).parent().hover(function () {
                        j(this).not(".active").children().stop().fadeTo(100, 1)
                    }, function () {
                        j(this).not(".active").children().stop().fadeTo(400, 0.6)
                    });
                    I.index === r.show && j(I.thumbTarget).css("opacity", 1)
                }
            });
            this.bind("loadstart", function (I) {
                I.cached || this.$("loader").show().fadeTo(200, 0.4);
                this.$("info").toggle(this.hasInfo());
                j(I.thumbTarget).css("opacity", 1).parent().siblings().children().css("opacity", 0.6)
            });
            this.bind("loadfinish", function () {
                this.$("loader").fadeOut(200)
            })
        }
    });
    G.make(4, {
        defaults: {
            transition: "pulse",
            thumbCrop: "width",
            imageCrop: false,
            carousel: false,
            show: false,
            easing: "galleriaOut",
            thumbEventType: Galleria.TOUCH ? "mousedown" : "click",
            _webkitCursor: true,
            _animate: true
        },
        init: function (r) {
            this.addElement("preloader", "loaded", "close").append({
                container: "preloader",
                preloader: "loaded",
                stage: "close"
            });
            var u = this,
                O = this.$("stage"),
                L = this.$("thumbnails"),
                I = this.$("images"),
                V = this.$("info"),
                W = this.$("loader"),
                M = this.$("target"),
                Z = 0,
                ga = M.width(),
                T = 0,
                ea = r.show,
                ca = false,
                fa = Galleria.TOUCH ? "mousedown" : "click",
                b = function (t) {
                    u.$("info").css({
                        left: Math.max(20, j(window).width() / 2 - t / 2 + 10)
                    })
                },
                ka = function (t, d) {
                    d = j.extend({
                        speed: 400,
                        width: 190,
                        onbrick: function () {},
                        onheight: function () {},
                        delay: 0,
                        debug: false
                    }, d);
                    t = j(t);
                    var i = t.children(),
                        m = t.width(),
                        o = Math.floor(m / d.width),
                        z = [],
                        C, F, E;
                    m = {
                        "float": "none",
                        position: "absolute",
                        display: j.browser.safari ? "inline-block" : "block"
                    };
                    if (t.data("colCount") !== o) {
                        t.data("colCount", o);
                        if (i.length) {
                            for (C = 0; C < o; C++) z[C] = 0;
                            t.css("position", "relative");
                            i.css(m).each(function (p, v) {
                                v = j(v);
                                for (C = o - 1; C > -1; C--) if (z[C] === Math.min.apply(window, z)) F = C;
                                E = {
                                    top: z[F],
                                    left: d.width * F
                                };
                                if (!(typeof E.top !== "number" || typeof E.left !== "number")) {
                                    if (d.speed) window.setTimeout(function (H, J, K) {
                                        return function () {
                                            H.animate(K, {
                                                easing: "galleriaOut",
                                                duration: J.speed,
                                                complete: J.onbrick
                                            })
                                        }
                                    }(v, d, E), p * d.delay);
                                    else {
                                        v.css(E);
                                        d.onbrick.call(v)
                                    }
                                    v.data("height") || v.data("height", v.outerHeight(true));
                                    z[F] += v.data("height")
                                }
                            });
                            i = Math.max.apply(window, z);
                            if (!(i < 0)) if (typeof i === "number") if (d.speed) t.animate({
                                height: Math.max.apply(window, z)
                            }, d.speed, d.onheight);
                            else {
                                t.height(Math.max.apply(window, z));
                                d.onheight.call(t)
                            }
                        }
                    }
                };
            Galleria.OPERA && this.$("stage").css("display", "none");
            this.bind("fullscreen_enter", function () {
                I.css("visibility", "hidden");
                O.show();
                this.$("container").css("height", "100%");
                ca = true
            });
            this.bind("fullscreen_exit", function () {
                O.hide();
                L.show();
                V.hide();
                ca = false
            });
            this.bind("thumbnail", function (t) {
                this.addElement("plus");
                var d = t.thumbTarget,
                    i = this.$("plus").css({
                        display: "block"
                    }).insertAfter(d),
                    m = 0;
                r.showInfo && this.hasInfo(t.index) && i.append("<span>" + this.getData(t.index).title + "</span>");
                T = T || j(d).parent().outerWidth(true);
                j(d).css("opacity", 0);
                Galleria.IE ? i.hide() : i.css("opacity", 0);
                j(d).parent().hover(function () {
                    Galleria.IE ? i.show() : i.stop().css("opacity", 1)
                }, function () {
                    Galleria.IE ? i.hide() : i.stop().animate({
                        opacity: 0
                    }, 300)
                }).data("index", t.index);
                Z++;
                this.$("loaded").css("width", Z / this.getDataLength() * 100 + "%");
                if (Z === this.getDataLength()) {
                    this.$("preloader").fadeOut(100);
                    ka(L, {
                        width: T,
                        speed: r._animate ? 400 : 0,
                        onbrick: function () {
                            var o = this;
                            window.setTimeout(function () {
                                j(o).find("img").animate({
                                    opacity: 1
                                }, r.transition_speed).parent().bind(fa, function () {
                                    L.hide();
                                    V.hide();
                                    var z = j(this);
                                    u.enterFullscreen(function () {
                                        if (z.data("index") === ea) {
                                            I.css("visibility", "visible");
                                            V.toggle(u.hasInfo())
                                        }
                                    })
                                })
                            }, r._animate ? m * 100 : 0);
                            m++
                        },
                        onheight: function () {
                            M.height(L.height())
                        }
                    })
                }
            });
            this.bind("loadstart", function (t) {
                t.cached || W.show()
            });
            this.bind("loadfinish", function (t) {
                V.hide();
                ea = this.getIndex();
                I.css("visibility", "visible");
                W.hide();
                if (this.hasInfo() && r.showInfo) V.fadeIn(r.transition ? r.transitionSpeed : 0);
                b(t.imageTarget.width)
            });
            this.bind("image", function (t) {
                j(t.imageTarget).click(function () {
                    u.exitFullscreen()
                })
            });
            if (!Galleria.TOUCH) {
                this.addIdleState(this.get("image-nav-left"), {
                    left: -100
                });
                this.addIdleState(this.get("image-nav-right"), {
                    right: -100
                });
                this.addIdleState(this.get("info"), {
                    opacity: 0
                });
                this.addIdleState(this.get("close"), {
                    top: -50
                })
            }
            this.$("container").css({
                width: r.width,
                height: "auto"
            });
            r._webkitCursor && Galleria.WEBKIT && this.$("image-nav-right,image-nav-left").addClass("cur");
            this.$("close").click(function () {
                u.exitFullscreen()
            });
            j(window).resize(function () {
                if (ca) u.getActiveImage() && b(u.getActiveImage().width);
                else {
                    var t = M.width();
                    if (t !== ga) {
                        ga = t;
                        ka(L, {
                            width: T,
                            delay: 50,
                            debug: true,
                            onheight: function () {
                                M.height(L.height())
                            }
                        })
                    }
                }
            })
        }
    })
})(jQuery);
(function (j) {
    var r = {
        ignoreFiles: ["index.htm", "index.html", "index.shtml", "index.cgi", "index.php"],
        strictQuery: true,
        ignore: function () {
            return RegExp("(" + this.ignoreFiles.join("|") + ")", "i")
        },
        window: function () {
            var u = window.location,
                O = u.href.cleanPath(this.ignore()).split("/");
            u = u.search.substring(1).length > 0 ? u.search.substring(1).split("&") : [];
            this.strictQuery || u.sort();
            return O.concat(u)
        },
        anchor: function (u) {
            var O = u.getAttribute("href", 1);
            if (!O || u.nodeName != "A") return false;
            u = window.location;
            O = O.absUrl().cleanPath(this.ignore());
            if (O === (u.protocol + "//" + u.hostname).replace(/www\./, "").noSlash()) return false;
            u = O.split("?");
            O = u[0].noSlash().split("/");
            u = u.length > 1 ? u[1].split("&") : [];
            this.strictQuery || u.sort();
            return O.concat(u)
        },
        compareArray: function (u, O) {
            if (u.length != O.length) return false;
            for (var L = 0; L < O.length; L++) if (u[L] !== O[L]) return false;
            return true
        },
        match: function (u) {
            if (j(u).attr("href") == "#") return false;
            var O = this.anchor(u),
                L = this.window();
            if (u.pathname.split("/").length < 3) return this.compareArray(L, O);
            return L.length < O.length ? false : this.compareArray(L.slice(0, O.length), O)
        },
        current: function (u) {
            if (j(u).attr("href") == "#") return false;
            u = this.anchor(u);
            return this.compareArray(this.window(), u)
        }
    };
    j.extend(j.expr[":"], {
        path: function (u) {
            return r.match(u)
        }
    });
    j.extend(j.expr[":"], {
        current: function (u) {
            return r.current(u)
        }
    });
    String.prototype.noSlash = function () {
        return this.lastIndexOf("/") === this.length - 1 || this.lastIndexOf("#") === this.length - 1 ? this.substr(0, this.length - 1) : this.toString()
    };
    String.prototype.absUrl = function () {
        var u = window.location,
            O, L;
        if (/^\w+:/.test(this)) return this.toString();
        O = u.protocol + "//" + u.host;
        if (this.indexOf("/") === 0) return O + this.toString();
        u = u.pathname.replace(/\/[^\/]*$/, "");
        if (L = this.match(/\.\.\//g)) {
            var I = this.substring(L.length * 3);
            for (L = L.length; L--;) u = u.substring(0, u.lastIndexOf("/"))
        } else I = this.toString();
        return O + u + "/" + I
    };
    String.prototype.cleanPath = function (u) {
        return this.replace(/www\./i, "").replace(u, "").replace(/\.\//, "").noSlash().toString()
    }
})(jQuery);